Jump to content

Turning off undefined variable error without disabling error reporting


sepoto

Recommended Posts

I am trying to supress the display of this:

Notice: Undefined variable: closedhh in C:\inetpub\wwwroot\dsgog\edit_profile.php on line 124 Call Stack # Time Memory Function Location 1 0.0231 382192 {main}( ) ..\edit_profile.php:0

Without really turning off my error reporting. Is this possible to do by using code in my php file? I would rather do that than modify my php.ini.Thank you!

Link to comment
Share on other sites

You can use '@' oprator to supress error.http://www.php.net/manual/en/language.oper...s.execution.phpthere is also option for setting ini_set() in your script to change the setting dynamicaly in the script. You can log the errors also. without changing the php.ini

Link to comment
Share on other sites

I wouldn't really advocate the use of error surpression. As a developer, you should want to know when there are errors and try and handle them. Why not test the value of the variable and handle it that way, possible by re-assigning it a value. Or better yet, just initialize it....

Link to comment
Share on other sites

I wouldn't really advocate the use of error surpression. As a developer, you should want to know when there are errors and try and handle them. Why not test the value of the variable and handle it that way, possible by re-assigning it a value. Or better yet, just initialize it....
If only the original programmer of this 2000 lines of code where that wise.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...