php-src/Zend/tests/bug60738.phpt
Nikita Popov c815dd74bc Allow resetting the error handler
This allows the error handler to be reset using set_error_handler(null).
As the code suggests this behavior was already previously intended, but
the callback check was done too strictly.
2012-09-22 21:46:02 +02:00

18 lines
290 B
PHP

--TEST--
Bug #60738 Allow 'set_error_handler' to handle NULL
--FILE--
<?php
set_error_handler(function() { echo 'Intercepted error!', "\n"; });
trigger_error('Error!');
set_error_handler(null);
trigger_error('Error!');
?>
--EXPECTF--
Intercepted error!
Notice: Error! in %s on line %d