array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.register-tick-function.php', 1 => 'register_tick_function', ), 'up' => array ( 0 => 'ref.funchand.php', 1 => '函数处理 函数', ), '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' => 'zh', '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 — 注册一个函数以便在每个 tick 上执行
callback
需要注册的函数。
args
示例 #1 register_tick_function() 示例
<?php
declare(ticks=1);
// using a function as the callback
register_tick_function('my_function', true);
// using an object->method
$object = new my_class();
register_tick_function(array($object, 'my_method'), true);
?>