Re: [RFC][Dynamic class constant fetch]

From: Date: Thu, 17 Nov 2022 20:21:02 +0000
Subject: Re: [RFC][Dynamic class constant fetch]
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-119017@lists.php.net to get a copy of this message
Hi everyone Sorry for the late reply. I won't waste too many lines on usefulness as it is highly subjective. The change will seem worth it to some people and not to others. IMO language consistency is important and mainly what I'm striving for. --- Hi MichaÅ‚ > Can it be extended to non class constants and additionally deprecations plan for constant() > function? I'm not sure what that syntax would look like. {$foo} is not a viable option since it is ambiguous or rather would require arbitrary lookahead (i.e. {$foo;} is valid syntax today). A different syntax would be possible but inconsistent with the existing options. In any case, this would likely require its own RFC and should be discussed separately. --- Hi Nikita > See > https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html#writes-and-memory-safetyb¤¬í > º¿JÍÚÙdæ7Ä for why the order of execution is the way it is. As class constants do not support > writes, these concerns do not apply, and the "normal" order can be used (as you propose). Thank you! I remembered discussing this back when implementing the nullsafe operator but was fuzzy on the details :) This makes more sense to me now. I tried to clarify in the RFC. Ilija

« previous php.internals (#119017) next »