From 823e330c75a7ed87dcdcd692f8672420c1abe244 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 17 Nov 2013 17:04:37 +0800 Subject: [PATCH] Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string) --- NEWS | 2 ++ ext/standard/basic_functions.c | 2 +- ext/standard/tests/general_functions/bug66094.phpt | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/general_functions/bug66094.phpt diff --git a/NEWS b/NEWS index 029e975b64..e06dc8334f 100644 --- a/NEWS +++ b/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) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a9ce7deefd..ba0051630f 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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); } 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-- + +--EXPECTF-- +Tick! +done -- 2.40.0