On Wed, 13 Oct 2004 22:25:50 -0700, "Jeremy Shovan"
<je********@foundationx.com> wrote:
In my code I have a block like this
----------------------------------------------------------------------
$old_error_handler = set_error_handler('HLErrorHandler');
// some code
restore_error_handler();
//some code
$old_error_handler = set_error_handler('HLErrorHandler');
----------------------------------------------------------------------
once I call the function 'restore_error_handler()' I can't set the error
handler back to ''HLErrorHandler''.
Does anyone know why?
Nope - it works for me. What does your code do? What version of PHP? Can you
give an actual example - the code you posted doesn't demonstrate the problem
since there's no definition of the error handler itself.
<pre>
<?php
function HLErrorHandler($errno, $errstr, $errfile, $errline)
{
print "kerplunk\n";
}
$old_error_handler = set_error_handler('HLErrorHandler');
trigger_error("boink", E_USER_NOTICE);
restore_error_handler();
trigger_error("boink", E_USER_NOTICE);
$old_error_handler = set_error_handler('HLErrorHandler');
trigger_error("boink", E_USER_NOTICE);
?>
</pre>
Outputs:
kerplunk
Notice: boink in D:\public_html\test.php on line 11
kerplunk
--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool