downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Agrégation d'objets> <register_tick_function
[edit] Last updated: Fri, 24 May 2013

view this page in

unregister_tick_function

(PHP 4 >= 4.0.3, PHP 5)

unregister_tick_functionAnnule la fonction exécutée à chaque tick

Description

void unregister_tick_function ( string $function_name )

Annule l'exécution automatique de function_name à chaque tick.

Liste de paramètres

function_name

Le nom de la fonction, sous la forme d'une chaîne de caractères.

Valeurs de retour

Aucune valeur n'est retournée.

Voir aussi



add a note add a note User Contributed Notes unregister_tick_function - [2 notes]
up
1
Greg
9 months ago
It's not so clear, but, at least as of PHP 5.3.13, you cannot use this inside of the handler itself as it will throw an error:

<?php

declare(ticks=2);

function
tick_handler()
{
   
unregister_tick_function('tick_handler');
}

register_tick_function('tick_handler');

set_time_limit(0);
usleep(500000);

?>

results in:

warning: unregister_tick_function(): Unable to delete tick function executed at the moment in [filename]

So if you want to unregister it must be done outside of the handler.
up
1
rob dot eyre at gmail dot com
1 year ago
Note that unregister_tick_function() can also accept a callback in the form of an array (either static, like array($className, $methodName) or instance, like array(&$this, $methodName)).

It cannot accept an anonymous function, however.

 
show source | credits | sitemap | contact | advertising | mirror sites