On Wed, 13 Oct 2004 22:25:50 -0700, "Jeremy Shovan"
<je********@fou ndationx.com> wrote:
In my code I have a block like this
----------------------------------------------------------------------
$old_error_han dler = set_error_handl er('HLErrorHand ler');
// some code
restore_error_ handler();
//some code
$old_error_han dler = set_error_handl er('HLErrorHand ler');
----------------------------------------------------------------------
once I call the function 'restore_error_ handler()' I can't set the error
handler back to ''HLErrorHandle r''.
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_hand ler = set_error_handl er('HLErrorHand ler');
trigger_error(" boink", E_USER_NOTICE);
restore_error_h andler();
trigger_error(" boink", E_USER_NOTICE);
$old_error_hand ler = set_error_handl er('HLErrorHand ler');
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.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool