register_tick_function

(PHP 4 >= 4.0.3, PHP 5, PHP 7, PHP 8)

register_tick_function注册一个函数以便在每个 tick 上执行

说明

register_tick_function(callable $callback, mixed ...$args): bool

注册给定的 callback,以便在 tick 被调用时执行。

参数

callback

需要注册的函数。

args

返回值

成功时返回 true, 或者在失败时返回 false

范例

示例 #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);
?>

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top