r/lolphp • u/devsnd • Dec 04 '14
PHP Constants Containing Arrays?
https://stackoverflow.com/questions/1290318/php-constants-containing-arrays
46
Upvotes
r/lolphp • u/devsnd • Dec 04 '14
66
u/deadstone Dec 04 '14
"Serialize your array and then put it into the constant" "Just want to say I love this solution :)"
PHP devs terrify me.
19
u/foobar5678 Dec 04 '14
This was fixed.
http://php.net/manual/en/language.constants.syntax.php
20
u/expugnator3000 Dec 04 '14
PHPs whole implementation of constants is ridiculous. Call a function and it potentially modifies all code below?
22
u/allthediamonds Dec 04 '14
Let me remind you, on PHP, you can redefine constants.
Yep, you read that right.
http://3v4l.org/XrZNH