Evil error reporting
Posted: Fri May 27, 2005 4:21 am
I'm developing a web service in PHP using nuSOAP and, for safety and security reasons, I would like to terminate the script in case ANY kind of notice, warning or error occurs. The desired behaviour would be to log the message and kill the script.
In this sample script, the notice is NOT logged and the script just continues its execution, and that can cause all sorts of other problems...
Is there any way to log everything (including notices) and terminate the script ?
PS: I've already looked into set_error_handler, but:
" The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called."
Thanks in advance !
Code: Select all
<?php
ini_set ("display_errors", "0");
function test ($i)
{
return ($i + 1);
}
test ($problem); //Notice: undefined variable
echo ("Script execution continues..."); //Unfortunately...
?>Is there any way to log everything (including notices) and terminate the script ?
PS: I've already looked into set_error_handler, but:
" The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called."
Thanks in advance !