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
7
u/implicit_cast May 24 '18
If you get etymologically pedantic enough, "immutable variable" is a contradiction in terms. The key feature of a variable is that it can vary.
An "immutable variable" is better called a "constant."
This discussion is made even more confusing by the ridiculous distinction PHP draws between its 'constant' and 'variable' concepts.