1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)

This commit is contained in:
Xinchen Hui
2013-11-17 17:04:37 +08:00
parent c9cfd98bcd
commit 823e330c75
3 changed files with 15 additions and 1 deletions

2
NEWS
View File

@@ -3,6 +3,8 @@ PHP NEWS
?? ??? 2013, PHP 5.4.23
- Core:
. Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a
string). (Laruence)
. Fixed bug #65947 (basename is no more working after fgetcsv in certain
situation). (Laruence)

View File

@@ -5724,7 +5724,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);
}

View File

@@ -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