php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66094 unregister_tick_function tries to cast a Closure to a string
Submitted: 2013-11-14 10:37 UTC Modified: 2013-11-17 10:34 UTC
From: [email protected] Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: master-Git-2013-11-14 (Git) OS: Irrelevant
Private report: No CVE-ID: None
 [2013-11-14 10:37 UTC] [email protected]
Description:
------------
Closures should be unregistrable too.

See also http://lxr.php.net/xref/PHP_TRUNK/ext/standard/basic_functions.c#5782

Test script:
---------------
declare(ticks=1);
register_tick_function($closure = function () { echo "Tick!\n"; });
unregister_tick_function($closure);

Expected result:
----------------
Tick!

// no error...

Actual result:
--------------
Tick!
PHP Catchable fatal error:  Object of class Closure could not be converted to string in php shell code on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-14 10:38 UTC] [email protected]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2013-11-17 09:38 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=823e330c75a7ed87dcdcd692f8672420c1abe244
Log: Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
 [2013-11-17 09:38 UTC] [email protected]
-Status: Assigned +Status: Closed
 [2013-11-17 10:34 UTC] [email protected]
-Assigned To: dmitry +Assigned To: laruence
 [2013-11-17 12:11 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=823e330c75a7ed87dcdcd692f8672420c1abe244
Log: Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
 [2013-11-18 13:04 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=823e330c75a7ed87dcdcd692f8672420c1abe244
Log: Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
 [2014-10-07 23:16 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=823e330c75a7ed87dcdcd692f8672420c1abe244
Log: Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
 [2014-10-07 23:27 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=823e330c75a7ed87dcdcd692f8672420c1abe244
Log: Fixed Bug #66094 (unregister_tick_function tries to cast a Closure to a string)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 21 09:00:02 2025 UTC