RE: require_once and E_WARNING?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux