Req #61693 [Opn->Wfx]: unregister_tick in registered function
| From: | laruence@php.net | Date: | Wed, 11 Apr 2012 15:07:32 +0000 |
| Subject: | Req #61693 [Opn->Wfx]: unregister_tick in registered function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169446@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61693&edit=1
ID: 61693
Updated by: laruence@php.net
Reported by: hugosmail at gmail dot com
Summary: unregister_tick in registered function
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: Unknown/Other Function
Operating System: Windows
PHP Version: 5.4.0
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2012-04-11 14:52:59] laruence@php.net
there is a list to reservers user tick functions, when doing tick call, php will
call user tick functions iteratively via go through that list.
if you delete the element which is calling, then the iterator will be messed .
of course, technically, it can be implemented, but the pay will be expensive.
and, I think you can do it like:
register_tick_function();
tick,
tick,
unregister_tick_functiono()
------------------------------------------------------------------------
[2012-04-11 12:46:05] hugosmail at gmail dot com
Description:
------------
Hi, while I'm trying call unregister_tick_function() in function executed by
register_tick_function(), I get a "Warning: unregister_tick_function(): Unable to delete tick
function executed at the moment"
I don't know, if this is a bug, but it may be very useful to call unregister like this.
Test script:
---------------
<?php
declare(ticks = 1);
function a() {
echo "a";
unregister_tick_function("a");
}
register_tick_function("a");
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61693&edit=1