Re: [PHP-DEV] [RFC] Property hooks, nee accessors

2023-05-13 Thread Matthew Brown
> > Regarding $field vs. $this->propName, there's a few reasons we went that > route. Overall I think this is a really good proposal, but you might want to consider a second vote for that particular syntax. `$field` vs `$this->propName` feels a little magical. It's a simpler magic than actual ma

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

2023-05-13 Thread Robert Landers
On Sat, May 13, 2023 at 11:05 AM Lydia de Jongh wrote: > > 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 const

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

2023-05-13 Thread Robert Landers
On Sat, May 13, 2023 at 5:58 PM Robert Landers wrote: > > > Can you provide more details on what the error conditions are? I can > > see 'non-existent static variable' and 'non-existent variable', are > > there others? > > Absolutely! I'll add it to the RFC later tonight, but the gist is that > it

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

2023-05-13 Thread Robert Landers
On Sat, May 13, 2023 at 5:18 PM Niels Dossche wrote: > > On 13/05/2023 09:27, Robert Landers wrote: > > Hello Internals, > > > > It is with much trepidation and excitement that I'd like to announce > > the `nameof` RFC (https://wiki.php.net/rfc/nameof). It has changed > > quite a bit in the last c

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

2023-05-13 Thread Robert Landers
> Can you provide more details on what the error conditions are? I can > see 'non-existent static variable' and 'non-existent variable', are > there others? Absolutely! I'll add it to the RFC later tonight, but the gist is that it would be exactly the same as if you were to call any function with

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

2023-05-13 Thread Robert Landers
> The one part of the RFC that surprised me was this: > > > When getting the name of constants and functions, the name will NOT be the > > full name, but the lexical name. This means that if the name is use'd, it > > will be that name. However, if the full name is used in the nameof(), the > > f

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

2023-05-13 Thread Niels Dossche
On 13/05/2023 09:27, Robert Landers wrote: > Hello Internals, > > It is with much trepidation and excitement that I'd like to announce > the `nameof` RFC (https://wiki.php.net/rfc/nameof). It has changed > quite a bit in the last couple of days, so if you haven't seen the > latest draft, please ch

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

2023-05-13 Thread Dan Ackroyd
On Sat, 13 May 2023 at 08:27, Robert Landers wrote: > > Hello Internals, > > It is with much trepidation and excitement that I'd like to announce > the `nameof` RFC (https://wiki.php.net/rfc/nameof). Can you provide more details on what the error conditions are? I can see 'non-existent static var

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

2023-05-13 Thread 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 example as a parameter in an Attribute. Don't confuse the syntax with the implementation: "::class" isn't actually a constant, and the

Re: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures

2023-05-13 Thread Rowan Tommins
On 13 May 2023 00:08:22 BST, Larry Garfield >A better argument, I think: > >The old function exists in 8.2, the new one does not. >The new one exists in 8.3. >The old one ceases to exist in 9.0. > >That means it's impossible to write code that works from 8.2 to 9.0 without >version checks. The o

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] [RFC] [Discussion] nameof

2023-05-13 Thread Robert Landers
Hello Internals, It is with much trepidation and excitement that I'd like to announce the `nameof` RFC (https://wiki.php.net/rfc/nameof). It has changed quite a bit in the last couple of days, so if you haven't seen the latest draft, please check it out. Essentially, it allows using `nameof()` an