array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.register-tick-function.php', 1 => 'register_tick_function', ), 'up' => array ( 0 => 'ref.funchand.php', 1 => 'Funciones de Manejo de Funciones', ), 'prev' => array ( 0 => 'function.register-shutdown-function.php', 1 => 'register_shutdown_function', ), 'next' => array ( 0 => 'function.unregister-tick-function.php', 1 => 'unregister_tick_function', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'es', 'path' => 'reference/funchand/functions/register-tick-function.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.3, PHP 5, PHP 7, PHP 8)
register_tick_function — Registrar una función para que sea ejecutada en cada tick
Registra la función dada por function
para ser ejecutada cuando se
llame a un tick.
function
El nombre de la función como cadena, o una matriz que consiste en un objeto y un método.
arg
...
Ejemplo #1 Ejemplo de register_tick_function()
<?php
declare(ticks=1);
// usar una función como llamada de retorno
register_tick_function('mi_función', true);
// usar un objeto->método
$objeto = new mi_clase();
register_tick_function(array(&$objeto, 'mi_método'), true);
?>
Versión | Descripción |
---|---|
5.3.0 | Los ticks ahora están soportados en los módulos de servidores web que usan hilos. |
No debería usarse register_tick_function() con módulos de servidores web que usan hilos con PHP 5.2 o anterior.