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
Status: Closed Package: *General Issues
PHP Version: master-Git-2013-11-14 (Git) OS: Irrelevant
Private report: No CVE-ID:
 [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)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 05:03:19 2014 UTC