4 ms·
I don't understand all the hate this article is generating, it's just a basic case of the 'easier to ask forgiveness than permission' vs 'look before you leap'
by bcoates 14y ago
I don't understand all the hate this article is generating, it's just a basic case of the 'easier to ask forgiveness than permission' vs 'look before you leap' styles.
PHP warnings are a debugging tool, not a substitute for exceptions. Suppressing them is not the equivalent of a catching and ignoring an exception.
Putting locks everywhere in a futile attempt to prevent the filesystem from changing under you is futile. It's fundamentally an external i/o device out of your program's control. It is never safe or reasonable to infer from the result of one filesystem operation that a subsequent one will not fail.