diff options
author | Nikita Popov <nikic@php.net> | 2012-03-24 13:10:51 +0100 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2012-09-22 21:46:18 +0200 |
commit | f28c128b207ae2c6ea4d8f6c2e66f5b709210a23 (patch) | |
tree | 5eb7508dbec5cbd6d92f0df947f9f8c44f415cac /Zend/tests/bug60738.phpt | |
parent | c815dd74bc42c8f36ba35b910f45e85a645d7e3d (diff) | |
download | php-git-f28c128b207ae2c6ea4d8f6c2e66f5b709210a23.tar.gz |
Return previous error handler when resetting the error handler
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.
Diffstat (limited to 'Zend/tests/bug60738.phpt')
-rw-r--r-- | Zend/tests/bug60738.phpt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Zend/tests/bug60738.phpt b/Zend/tests/bug60738.phpt index e0c9793fed..e4080715ec 100644 --- a/Zend/tests/bug60738.phpt +++ b/Zend/tests/bug60738.phpt @@ -3,15 +3,20 @@ Bug #60738 Allow 'set_error_handler' to handle NULL --FILE-- <?php -set_error_handler(function() { echo 'Intercepted error!', "\n"; }); +var_dump(set_error_handler( + function() { echo 'Intercepted error!', "\n"; } +)); trigger_error('Error!'); -set_error_handler(null); +var_dump(set_error_handler(null)); trigger_error('Error!'); ?> --EXPECTF-- +NULL Intercepted error! +object(Closure)#1 (0) { +} Notice: Error! in %s on line %d |