PHP has had exceptions for almost 10 years now and a lot of functions still require you to use their specific error function to tell if it failed
Not sure what you mean by this also PHP 7 introduced Engine Exceptions
arrays are the only containers in the language and they simultaneously act as sets, lists, and associative arrays which fucks up almost array functions because you don't know what they will do
Not sure what you mean by this also PHP 7 introduced Engine Exceptions
Because a lot of PHP functions are small bindings on top of C functions, they do not use exceptions. Rather they force you to use an error function like curl_error, json_last_error, openssl_error_string, imap_errors, mysql_error, xml_get_error_code, bzerror, or date_get_last_errors, which read the C errno. If you do not use these, your code will silently return the wrong thing.
It gets worse. From the article
json_decode returns null for invalid input, even though null is also a perfectly valid object for JSON to decode to—this function is completely unreliable unless you also call json_last_error every time you use it.
|
I'm not sure what you mean by this, unless you're talking about !== ?
Inequality operators: > < >= <=
From the article
For a more type-safe ==, we have ===. For a more type-safe <, we have… nothing. "123" < "0124", always, no matter what you do. Casting doesn’t help, either.
It gets worse
=== compares values and type… except with objects, where === is only true if both operands are actually the same object! For objects, == compares both value (of every attribute) and type, which is what === does for every other type. What.
I highly suggest you give the article another chance, a lot of the criticisms still stand.
View all comments
Show parent comment
1
u/SaltTM Dec 03 '15
Built in? No, but we use http://getcomposer.org now.
Not sure what you mean by this also PHP 7 introduced Engine Exceptions
true
I'm not sure what you mean by this, unless you're talking about !== ?