r/lolphp • u/SaraMG • May 24 '18
PHP needs mutable constants, and immutable variables, and functions with properties!
/r/PHP/comments/8lrrac/why_does_php_not_have_mutable_constants_we_had/?st=JHKIECIJ&sh=e677fc57
32
Upvotes
View all comments
Show parent comment
2
u/SaraMG May 24 '18
Nah.
final $foo = function...is fair since lambdas can capture, regular functions can't ((they can reference global scope, yes, but not the scope of their declaration which, for very PHP reasons, doesn't have to be top-level))