When my script runs, I have:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
And then I register my error handler with PHP:
function handleError($code, $text, $file, $line) {
echo "&%!!";
return true;
}
set_error_handler('handleError');
Next, the code that causes the error appears:
Fatal error: method undefinedDB :: getInstanceForDB () was called in /Applications/MAMP/htdocs/mysite/classes/Test.php on line 32
I continue to receive a standard PHP error message box with a call stack and everything on my site, regardless of whether I set a special error handler or not. Any idea what's wrong?
Edit: regardless of whether I return true or not, it does not call my custom handler.
source
share