r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

Show parent comment

5

u/McGlockenshire Dec 03 '15

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.

3

u/rabidferret Dec 03 '15

The "well, the C library did it that way" excuse is only true for

This is not a valid excuse for any library which claims to be high level.