News for hackers. Stuff that matters.
Re:PHP Sadness by z92 on Thursday November 29, 2018 @06:55AM (#18559570)
One can sort out a lot of PHP parameter order inconsistencies remembering that if $haystack is an array then it's the second parameter after $needle. For string it's the opposite.

    array_exists($needle, $haystack);
But

    substr($haystack, $needle);
Re:PHP Sadness by kijin on Thursday November 29, 2018 @07:20AM (#18559654)
You're probably thinking of in_array() and strpos(). Yeah, the names themselves are confusing, not just the order of arguments.

I wish PHP was fully object-oriented so you could call a method on any array, string, or number like in JavaScript. $haystack->contains($needle) is so much more consistent! That would eliminate the need for most of those confusing global functions, which can then be safely deprecated.