I have an error handling function defined that dumps $errno and $errstr, however, if I execute the following:
I get this:
2, include(1) [function.include]: failed to open stream: No such file or directory
2, include() [function.include]: Failed opening '1' for inclusion (include_path='.:/php-inc:/lib/php')
2, require(1) [function.require]: failed to open stream: No such file or directoryFatal error: require() [function.require]: Failed opening required '1' (include_path='.:/php-inc:/lib/php') in /path/to/index.php on line 44
It looks like require() throws a warning and an error, and for some reason, my error handling function is not picking up the E_ERROR and handling it gracefully...
Please disregard...rookie mistake. For those interested, set_error_handler() will not work on fatal errors. The workaround is setting error_reporting(0) (to suppress the default PHP browser output) and using register_shutdown_function("yourFatalErrorHandler").
In yourFatalErrorHandler(), you can grab the last error with error_get_last(), and then do whatever.
Lesson learned: RTFM, so please if you don't have 10+ years experience like me and someone tells you to RTFM, please don't pitch a fit...happens to us too.
Yep, I've been doing this full time for years, and still find myself referencing things. Experience means you know how to use the features well, it's not about memorizing every last thing. I like to RTFM.
Database design and performance optimization, custom PHP scripts, and publicly available resources for developers! http://www.zeropride.com