Page 1 of 1

Custom Error Handling Class

Posted: Fri Jun 29, 2007 3:27 am
by jamiel
Hi all,

Can someone please enlighten me as to why the following prints the fatal array without var dumping the params?

Code: Select all

#!/usr/bin/php
<?php
class Error_Handler
{
    public static function handle($foo, $bar, $baz, $delta)
    {
        var_dump($foo, $bar, $baz, $delta);
    }
}

set_error_handler(array('Error_Handler', 'handle'), E_ALL);

foo();

Output:

Fatal error: Call to undefined function foo() in /home/jamiel/test.php on line 13
Thanks

Jamie

Edit: Missed a bracket but same problem.

Posted: Fri Jun 29, 2007 3:46 am
by John Cartwright
I believe it's not possible to handle fatal errors using a custom error handler. Not positive though..