On Fri, Nov 4, 2022 at 3:26 PM Ilija Tovilo <tovilo.il...@gmail.com> wrote:

> Hi everyone
>
> I'd like to propose a simple RFC to introduce looking up class
> constants by name. We have dedicated syntax for basically all other
> language constructs. This RFC aims to get rid of this seemingly
> arbitrary limitation.
>
> https://wiki.php.net/rfc/dynamic_class_constant_fetch
>
> Please let me know if you have any thoughts.
>

The proposal looks reasonable to me. While I wouldn't expect this syntax to
see much use, it does remove a syntactical inconsistency in the language.

> Order of execution

See
https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html#writes-and-memory-safety
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).

Regards,
Nikita

Reply via email to