Error Handling.
Posted: Wed Apr 09, 2008 12:36 pm
I was reading php.net's thing on Error Reporting and I must obviously not get it quite well with making your own error handler. I setup a simple one from Zend to learn about it a little bit.
I started getting ridiculous amounts of errors about time zones on date(), strtotime(), etc (Err; 2048.) and Undefined indexes and variables (Err; 8.). But when the error handler isn't there everything works fine.
Should I not use the set_error_handler() and use error_reporting() instead?
Basically what I was trying to do was use set_error_handler() to log and email me when errors happen on my page. Or is there stuff wrong with my code? I really don't think there is because one example for instance is:
This is the code
Sorry as I have no knowledge of controlling error reports and logs but I desperately need to learn!
I started getting ridiculous amounts of errors about time zones on date(), strtotime(), etc (Err; 2048.) and Undefined indexes and variables (Err; 8.). But when the error handler isn't there everything works fine.
Should I not use the set_error_handler() and use error_reporting() instead?
Basically what I was trying to do was use set_error_handler() to log and email me when errors happen on my page. Or is there stuff wrong with my code? I really don't think there is because one example for instance is:
Code: Select all
Error code: 8
Error message: Undefined index: pg
Script name and line number of error: C:\wamp\www\index.php:28
Variable state when error occurred: homeThis is the code
Code: Select all
$get = strtolower($_GET['pg']);