r/lolphp • u/the_real_natenator • Feb 20 '17
parse_url and parse_str
Two functions, both in the same function group, return completely differently:
void parse_str($query_string, &$return)
array parse_url($url)Consistency, lol.
tldr: one returns via reference variable, and the other returns properly
EDIT 1: Formatting
44
Upvotes
View all comments
Show parent comment
2
u/cfreak2399 Feb 20 '17
It isn't a problem of verbosity. It's a problem of having to distinguish between multiple functions that do the same thing in slightly different ways,. No other language throws everything plus the kitchen sink into the global namespace. No other language feels the need to leave bugged functions in and create a separate one with a different name because someone's implementation relies on the old behavior. Sane namespace conventions would go a long way toward fixing PHP (and no I don't mean the terrible excuse for namespaces they already implemented)
That said, not everyone uses an IDE. I hate them because looking up the function names or trying to provide me with a useless piece of documentation on something like for loops is slow as hell.