How Ticks Work

Ticks work via the conjunction of two different mechanisms—a special type of control block called a declare block and the register_tick_function() function. The declare block allows zero or more expressions to be grouped together, while register_tick_function() allows the developer to set a tick function. The tick function will be called once for every one or more expressions within the declare block.

Declare Blocks

Declare blocks use a structure similar to other control blocks (such as while or for). The block has an initialization block, followed by a body section.

The initialization block (enclosed in parentheses) can contain special declare directives.As of PHP 4.0.6, only one directive is valid: ticks. Syntax for the ticks ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.