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-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).

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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to