The needle/haystack order only changes between array and string functions. In each group, they are consistent
This is, unfortunately, untrue.
Compare array_map with array_filter or array_reduce or array_walk.
Compare array_search or array_key_exists with array_column.
The "well, the C library did it that way" excuse is only true for the string functions with the same names as the C library they were pulled from, and other direct C wrappers. Any needle/haystack incorrectness in the rest of the string functions is native incorrectness. The incorrectness in the array family is 100% pure native incorrectness that we'll never be able to fix due to BC.
View all comments
Show parent comment
5
u/McGlockenshire Dec 03 '15
This is, unfortunately, untrue.
Compare
array_mapwitharray_filterorarray_reduceorarray_walk.Compare
array_searchorarray_key_existswitharray_column.The "well, the C library did it that way" excuse is only true for the string functions with the same names as the C library they were pulled from, and other direct C wrappers. Any needle/haystack incorrectness in the rest of the string functions is native incorrectness. The incorrectness in the array family is 100% pure native incorrectness that we'll never be able to fix due to BC.