Why does PHP have 67 different string functions with inconsistent naming?
D
dev_frustrated +890
Why does PHP have str_replace, strpos, substr, str_pad, str_repeat... but then strlen, strcmp, strstr? WHO DECIDED THIS?
P
php_historian +1200
Fun fact: the naming convention was based on which C function it was wrapping. Consistency was never the goal. Shipping was the goal.
S
senior_dev_42 +2100
The real fun is when you discover that array_key_exists() and in_array() have their needle/haystack arguments in OPPOSITE ORDERS.
I
intern_pain +670
I just spent 3 hours debugging because I used strpos() and forgot it returns 0 for position 0 which is falsy. I hate it here.
8,900 pts Source: manual
View original →