richrock Posted December 8, 2008 Share Posted December 8, 2008 I've been using php error reporting to refine some code I've written. I've checked out the manual, and am currently using error_reporting(E_ALL) but this throws up a lot of Undefined Index errors, most of which I know about, and as it's a multifunction page, I don't really need to deal with. Being the relative n00b at PHP, and never having used error_reporting, how could I use it to report all errors 'except' this undefined index? Quote Link to comment https://forums.phpfreaks.com/topic/136038-solved-error-reporting-except/ Share on other sites More sharing options...
sasa Posted December 8, 2008 Share Posted December 8, 2008 http://www.php.net/error_reporting RTFM Quote Link to comment https://forums.phpfreaks.com/topic/136038-solved-error-reporting-except/#findComment-709295 Share on other sites More sharing options...
trq Posted December 8, 2008 Share Posted December 8, 2008 While I would recommend fixing your code so there are no errors or warnings it sounds like your looking for a hack to avoid warnings. error_reporting(E_ERROR) will avoid warnings and only trigger errors. Quote Link to comment https://forums.phpfreaks.com/topic/136038-solved-error-reporting-except/#findComment-709301 Share on other sites More sharing options...
PFMaBiSmAd Posted December 8, 2008 Share Posted December 8, 2008 Each line of code that php encounters that triggers an undefined error or any other error takes 10-20 times longer to execute because php must go through its error response code to deal with it. Turning off error_reporting only affects the last step in that error response code of actual reporting the error. Which is why the setting is called error_reporting and not fixed_your_actual_code_so_it_no_longer_generates_an_error() Use isset() or empty() to test a variable that might not exist at runtime. Code should not normally be generating any type of errors when it executes. Quote Link to comment https://forums.phpfreaks.com/topic/136038-solved-error-reporting-except/#findComment-709437 Share on other sites More sharing options...
richrock Posted December 8, 2008 Author Share Posted December 8, 2008 many thanks! It seems I'll have to do some research on the isset() and empty() to help improve the code speed, although that's not a great issue here, as the script's only going to be used by a maximum of four people ever, and seems plenty fast enough (just basic form handling for names & addresses)... Thanks again all! Quote Link to comment https://forums.phpfreaks.com/topic/136038-solved-error-reporting-except/#findComment-709447 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.