Skip to content

Commit 823e330

Browse files
committed
Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
1 parent c9cfd98 commit 823e330

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP NEWS
33
?? ??? 2013, PHP 5.4.23
44

55
- Core:
6+
. Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a
7+
string). (Laruence)
68
. Fixed bug #65947 (basename is no more working after fgetcsv in certain
79
situation). (Laruence)
810

ext/standard/basic_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5724,7 +5724,7 @@ PHP_FUNCTION(unregister_tick_function)
57245724
return;
57255725
}
57265726

5727-
if (Z_TYPE_P(function) != IS_ARRAY) {
5727+
if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) {
57285728
convert_to_string(function);
57295729
}
57305730

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
3+
--FILE--
4+
<?php
5+
declare(ticks=1);
6+
register_tick_function($closure = function () { echo "Tick!\n"; });
7+
unregister_tick_function($closure);
8+
echo "done";
9+
?>
10+
--EXPECTF--
11+
Tick!
12+
done

0 commit comments

Comments
 (0)