RE: [PHP] require_once and E_WARNING?
| From: | KermodeBear | Date: | Thu, 06 Jul 2006 15:40:48 +0000 |
| Subject: | RE: [PHP] require_once and E_WARNING? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239175@lists.php.net to get a copy of this message | ||
chris smith wrote:
> try it with a call to an undefined function e.g.:
> $foo = thisFunctionDoesNotExistAtLeastItHadBetterNot();
When this is done, the error handler doesn't get called at all, and the
script simply dies with an error message (which could be a bug as well, but
might also be considered a 'parse error' even if it happens at runtime; I
doubt they would fix it).
I read through the set_error_handler() documentation again though, and I
found that: " The following error types cannot be handled with a user
defined function: E_ERROR[...]"
So, I'm guessing that the require() functions raise an E_WARNING before the
E_ERROR. Seems odd. Perhaps what happens "under the hood" is that require()
calls include(), which would raise an E_WARNING when it fails, then the
require() code checks the result of include() and if it failed then it
raises the E_ERROR.
It pays to RTFM more closely, it seems. (o; My bad.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php