-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I've just found two PHP scripts that contain code like this:
$x = fopen(...); while (!feof($x)) { ... }
This is unfortunate, because it creates an infinite loop when fopen fails: since $x is not a file handle, feof() will never return true, and the loop will never end.
This is particularly serious with PHP because the infinite loop creates a log message every time, which fills the system disk, but it's something to be avoided in any language.
Error handling is not just a nicety. Doing it wrong creates serious bugs. Do it right.
- river.