![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||||||||
declareThe declare construct is used to set execution directives for a block of code. The syntax of declare is similar to the syntax of other flow control constructs: The directive section allows the behavior of the declare block to be set. Currently only one directive is recognized: the ticks directive. (See below for more information on the ticks directive) The statement part of the declare block will be executed -- how it is executed and what side effects occur during execution may depend on the directive set in the directive block. The declare construct can also be used in the global scope, affecting all code following it.
TicksA tick is an event that occurs for every N low-level statements executed by the parser within the declare block. The value for N is specified using ticks=N within the declare blocks's directive section. The event(s) that occur on each tick are specified using the register_tick_function(). See the example below for more details. Note that more than one event can occur for each tick.
Ticks are well suited for debugging, implementing simple multitasking, background I/O and many other tasks. See also register_tick_function() and unregister_tick_function(). Copyright © 1997 - 2007 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. A copy of the Open Publication License is distributed with this manual, the latest version is presently available at http://www.opencontent.org/openpub/. Please see full copyright text at http://www.php.net/manual/en/copyright.php Original version of the above documentation is available at http://www.php.net/manual/en/ |
|