Re: [PHP-DEV] [RFC] [Discussion] nameof

2023-05-16 Thread Lydia de Jongh
Op ma 15 mei 2023 om 20:06 schreef Rowan Tommins : > > On 15 May 2023 14:07:31 BST, Lydia de Jongh wrote: > >> ... > >> #[SomeAttribute(callback: nameof(\Acme\bar(...))] > >> ... > > > >This callback to nameof(). is really terrible 😣😣 > >

Re: [PHP-DEV] [RFC] [Discussion] nameof

2023-05-15 Thread Lydia de Jongh
(I hope it is ok that I take parts from several mails) Op za 13 mei 2023 om 12:37 schreef Rowan Tommins : > On 13 May 2023 10:04:39 BST, Lydia de Jongh wrote: > > >I prefer a magic constant like `::name` instead of a function call as it > >can be used in a wider scope; for exam

Re: [PHP-DEV] [RFC] [Discussion] nameof

2023-05-13 Thread Lydia de Jongh
Wow! Yess please. My mail yesterday crossed yours, I guess (thanks Claude for answering) asking for almost the same: myClass::$normalProperty::name So I would like to add my thoughts to your proposal. I prefer a magic constant like `::name` instead of a function call as it can be used in a wider

[PHP-DEV] Proposal: magic constant '::name' for properties and methods etc. like '::class' is for classes/object

2023-05-12 Thread Lydia de Jongh
Hi, Lately I made a small object initializer/builder with php Attributes. 'Directly' accessing properties and methods of the class as a parameter in an Attribute is not really possible. You can do that for a class with: \path\to\MyClass::class, but for properties or methods you have to use string

Re: [PHP-DEV] Moving PHP internals to GitHub

2023-04-12 Thread Lydia de Jongh
Hi, Interesting discussion I do prefer a good organised forum above a mailinglist: - better overview - better searchable - quicker to read - less mail - possibility to give likes As a newcomer here, it is hard to find previous information. Even on externals.io. That signing on to the mailin

Re: [PHP-DEV] [RFC] Working With Substrings

2023-02-16 Thread Lydia de Jongh
Hi Derick, Thomas, Op do 16 feb. 2023 om 08:57 schreef Derick Rethans : > > > https://wiki.php.net/rfc/unicode_text_processing > > And yes, that won't be as fast as just calling strtoupper. > > cheers > Derick > Looks great!!! Complex string manipulation inside an object will be faster then al

Re: [PHP-DEV] [RFC] Working With Substrings

2023-02-15 Thread Lydia de Jongh
Hi, Very interesting topic! On which I have NO experience 🙈 Op wo 15 feb. 2023 om 08:02 schreef Rowan Tommins : > On 15 February 2023 05:18:50 GMT, Rowan Tommins > wrote: > >My instinct was that it could just be a built-in class, with an internal > pointer to a zend_string that's completely in

Re: [PHP-DEV] 'Uninitialized' creates a lot of cluttering

2023-02-12 Thread Lydia de Jongh
Hi, Thanks for all the answers so far. On 2/8/23 17:04, naitsi...@e.mail.de wrote: > > Would it make sense to make "null" the default value for nullable properties at least? > > So that one could write > > > > class Test { > > public ?string $name; > > } > > > > var_dump((new Test())

Re: [PHP-DEV] 'Uninitialized' creates a lot of cluttering

2023-02-08 Thread Lydia de Jongh
Hi Kamil, Thanks for your reply. With regards to the automatic default, of course I can only agree! Indeed isset() should not be needed for declared properties! But because of the typed properties, you have to initialize them before you can access them. I think that is cluttering up the code. >F

[PHP-DEV] 'Uninitialized' creates a lot of cluttering

2023-02-08 Thread Lydia de Jongh
ults to [] protected ?string $optionalVar; // defaults to null protected string $table = 'category'; protected !bool $isOk; // defaults to false protected !float $someNumber; // default to 0 protected ?myObject $oObject; // no default for objects... to complicated and risky