summaryrefslogtreecommitdiff
path: root/Zend/tests/bug60738.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2012-03-24 12:52:15 +0100
committerNikita Popov <nikic@php.net>2012-09-22 21:46:02 +0200
commitc815dd74bc42c8f36ba35b910f45e85a645d7e3d (patch)
treedaaa7767a88fb50e42e87100ec024b9bd5052c40 /Zend/tests/bug60738.phpt
parent4954aba2edbc4e29b8b18837298016b435ff7968 (diff)
downloadphp-git-c815dd74bc42c8f36ba35b910f45e85a645d7e3d.tar.gz
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.
Diffstat (limited to 'Zend/tests/bug60738.phpt')
-rw-r--r--Zend/tests/bug60738.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/bug60738.phpt b/Zend/tests/bug60738.phpt
new file mode 100644
index 0000000000..e0c9793fed
--- /dev/null
+++ b/Zend/tests/bug60738.phpt
@@ -0,0 +1,17 @@
+--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