Originally posted by AstroTeg
[man]set_error_handler [/man] might be for you.
Apparently not, as I suggested that also.
But no, try/catch is not available in PHP v4 (I think in v5 its available).
They are being added to v5; there is a builtin class entitled "Exception" which has 2 member functions, getFile and getLine, that return values kinda as you'd expect, or you can do something like this:
try {
something;
throw Exception
something_else;
}
catch(class $var) {
yet_another_something;
}
I have mixed feelings about try/catch. If you have to rely on try/catch to make your code work, then you're writing sloppy code.
This seems logical to me as well; however, I've not written every program in the world yet 😉
It might be interesting or helpful to know just what kind of errors dman is expecting...
Originally posted by dman2004
I looked around and I don't think it exists. If there's an error in your if statements you'll get an error on the screen. What I am looking for is to completely ignore the the code.
This isn't entirely true, because it depends on the severity of the error, and what you have done to prepare for that possibility. Small errors can be ignored using the "@" operator. If there is a more severe error, what is fed to the browser is highly dependent on php's configuration for error reporting. In a properly set-up production environment, at worst you get a blank page when a fatal error was encountered...the errors should go the httpd-error.log ...