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: bwoebi@php.net Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: master-Git-2013-11-14 (Git) OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bwoebi@php.net
New email:
PHP Version: OS:

 

 [2013-11-14 10:37 UTC] bwoebi@php.net
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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-14 10:38 UTC] bwoebi@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2013-11-17 09:38 UTC] laruence@php.net
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] laruence@php.net
-Status: Assigned +Status: Closed
 [2013-11-17 10:34 UTC] bwoebi@php.net
-Assigned To: dmitry +Assigned To: laruence
 [2013-11-17 12:11 UTC] johannes@php.net
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] ab@php.net
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] stas@php.net
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] stas@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC