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:
2
NEWS
2
NEWS
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
12
ext/standard/tests/general_functions/bug66094.phpt
Normal file
12
ext/standard/tests/general_functions/bug66094.phpt
Normal 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
|
||||
Reference in New Issue
Block a user