mirror of
https://github.com/php/php-src.git
synced 2024-12-22 00:10:16 +08:00
f28c128b20
set_error_handler(null) and set_exception_handler(null) now return the previous error/exception handler instead of just returning bool(true). This is consistent with the behavior of these functions with non-null values.
23 lines
347 B
PHP
23 lines
347 B
PHP
--TEST--
|
|
Bug #60738 Allow 'set_error_handler' to handle NULL
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(set_error_handler(
|
|
function() { echo 'Intercepted error!', "\n"; }
|
|
));
|
|
|
|
trigger_error('Error!');
|
|
|
|
var_dump(set_error_handler(null));
|
|
|
|
trigger_error('Error!');
|
|
?>
|
|
--EXPECTF--
|
|
NULL
|
|
Intercepted error!
|
|
object(Closure)#1 (0) {
|
|
}
|
|
|
|
Notice: Error! in %s on line %d
|