mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +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.
24 lines
421 B
PHP
24 lines
421 B
PHP
--TEST--
|
|
Bug #60738 Allow 'set_error_handler' to handle NULL
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(set_exception_handler(
|
|
function() { echo 'Intercepted exception!', "\n"; }
|
|
));
|
|
|
|
var_dump(set_exception_handler(null));
|
|
|
|
throw new Exception('Exception!');
|
|
?>
|
|
--EXPECTF--
|
|
NULL
|
|
object(Closure)#1 (0) {
|
|
}
|
|
|
|
Fatal error: Uncaught exception 'Exception' with message 'Exception!' in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|
|
|