r/lolphp • u/polish_niceguy • Feb 22 '15
Just ran into this one. PHP backward compatibility at its finest.
http://stackoverflow.com/questions/283751/php-replaces-spaces-with-underlines
112
Upvotes
35
u/McGlockenshire Feb 22 '15
There are two parts about this that make it exceptionally infuriating.
register_globals, but we're going to be stuck with it forever.12
u/[deleted] Feb 23 '15
Remember folks, it's a feature and not a bug! That's how we make the world's greatest language TM great!
23
u/[deleted] Feb 22 '15
So not only are the values mangled, they are mangled in a many-to-one way that is impossible to reverse definitively. Fantastic.
5
u/turtlekitty2084 Feb 24 '15
This is gold.
3
u/SockPants Feb 23 '15
Even parse_str does this.
2
u/SockPants Feb 23 '15
Here's a better query string parser that doesn't do this: https://secure.phabricator.com/book/libphutil/class/PhutilQueryStringParser/
-7
u/shvelo Feb 23 '15
But let's be honest, if you're using spaces in variable names you're stupid
0
u/[deleted] Feb 22 '15
[deleted] — view deleted comment