In PHP, you can handle errors by calling or die
to exit when you encounter certain errors, like this:
$handle = fopen($location, \"r\") or die(\"Cou
I've also stumbled upon that once. All I could find was this:
https://bugs.php.net/bug.php?id=40712
Look at the comment down below:
this is not a bug
I've searched in the documentation and I think it's due to the fact that return 0
is a statement whereas die()
is essentially an expression. You can't run $handle = return 0;
but $handle = fun();
is valid code.
Regarding error handling I would recommend custom codes or using custom handlers and triggers. The latter are described here for example.