I love finding more examples of PHP's consistent inconsistencies!
Two from work that we ran into:
php > set_error_handler(function($errno, $errstr) { print_r([$errno, $errstr]); });
php > $f->foo;
Array
(
[0] => 8
[1] => Trying to get property of non-object
)
php > $f->get('foo');
Fatal error: Call to a member function get() on null in php shell code on line 1
We ran into that one where for some reason a variable was null and I had recently change it from directly accessing a property to using the getter method. This caused some users to see a non-fully rendered page because of the error. And we didn't get an email about it because it doesn't fucking call the error handler!
Another one that I can't blame solely on PHP but was still annoying. One of our programmers was doing `floatval(number_format($foo, 2))` to round instead of just doing `round()` and for some reason I didn't catch it in review. But, that produces a nice error if the number is 1000 or more
php > $price = "1012.19";
php > echo number_format($price, 2);
1,012.19
php > echo floatval(number_format($price, 2));
1
php >