diff options
author | Xinchen Hui <laruence@php.net> | 2013-11-17 17:05:04 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2013-11-17 17:05:04 +0800 |
commit | de79c51555a9bcc4d10cdcf2337986cc3321f4e9 (patch) | |
tree | 550926893c5c7286b0f9b99463dcecab0b6abd1f | |
parent | d0cd1127024410bd7b055500d1bd879c4187b832 (diff) | |
parent | 823e330c75a7ed87dcdcd692f8672420c1abe244 (diff) | |
download | php-git-de79c51555a9bcc4d10cdcf2337986cc3321f4e9.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
-rw-r--r-- | ext/standard/basic_functions.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/bug66094.phpt | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index b4128e066b..96b3c30bbd 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5776,7 +5776,7 @@ PHP_FUNCTION(unregister_tick_function) return; } - if (Z_TYPE_P(function) != IS_ARRAY) { + if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) { convert_to_string(function); } diff --git a/ext/standard/tests/general_functions/bug66094.phpt b/ext/standard/tests/general_functions/bug66094.phpt new file mode 100644 index 0000000000..8b33a4f4c3 --- /dev/null +++ b/ext/standard/tests/general_functions/bug66094.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #66094 (unregister_tick_function tries to cast a Closure to a string) +--FILE-- +<?php +declare(ticks=1); +register_tick_function($closure = function () { echo "Tick!\n"; }); +unregister_tick_function($closure); +echo "done"; +?> +--EXPECTF-- +Tick! +done |