|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-04 03:02 UTC] quirenbach at moe dot de
Description:
------------
you can repeated register a same tick_function. but can not remove them once.
Test script:
---------------
<?php
function a () {
echo 2;
}
register_tick_function("a");
register_tick_function("a");
unregister_tick_function("a");
declare(ticks=1);
echo 1;
echo 1;
Expected result:
----------------
11
Actual result:
--------------
221212
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 08:00:01 2025 UTC |
Calling unregister_tick_function() twice removes both tick functions, so I'd say this is behaving as expected. Example: <?php declare(ticks=1); function a() { echo "tick\n"; } echo "Registering...\n"; register_tick_function('a'); register_tick_function('a'); foreach (range(0, 5) as $i) {} unregister_tick_function('a'); unregister_tick_function('a'); echo "Unregistered.\n"; foreach (range(0, 5) as $i) {} ?> Only outputs "tick" between "Registering..." and "Unregistered.".