Jump to content

[SOLVED] Error reporting except...


richrock

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/136038-solved-error-reporting-except/
Share on other sites

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.

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!  ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.