Re: [RFC] [Discussion] nameof

From: Date: Sat, 13 May 2023 15:18:12 +0000
Subject: Re: [RFC] [Discussion] nameof
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-120261@lists.php.net to get a copy of this message
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 check it out. > > Essentially, it allows using nameof() anywhere a string can be > used, > even in static contexts. From a developer's perspective, it is a > string and from the engine's perspective, it is also mostly a string > (depending on how deep we want to go on error checking -- see the > RFC). > > If anything is unclear or if I missed something, please let me know. > > Robert Landers > Software Engineer > Utrecht NL > Hello Robert Thank you for doing the proposal. I can see some places where I might use this. I have an additional question that I don't think has been asked yet. About the interaction of nameof with "variable variables": What should be returned by nameof($$variable), and similarly nameof($$$variable), etc? Defining the semantics for this, and giving examples in the RFC text would be great :) Good luck with your RFC. Cheers Niels

« previous php.internals (#120261) next »