note 20010 added to control-structures.declare
| From: | rob_spamsux at rauchmedien dot ihatespam dot com | Date: | Tue, 19 Mar 2002 06:58:55 +0000 |
| Subject: | note 20010 added to control-structures.declare | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27944@lists.php.net to get a copy of this message | ||
Here is an example of multi-tasking / multi-threading:
# declare functions
function a() {
echo "a";
}
function b() {
echo "b";
}
# register tick functions
register_tick_function ("a");
register_tick_function ("b");
# make the tick functions run
declare (ticks=1);
# that's all there is to it.
Notes:
This will make functions a and b run once each at the same time.
If you try:
declare (ticks=1) {
1;
}
They will run twice each. That is because it seems to be an undocumented fact that there is always
an extra tick.
Therefore:
declare (ticks=2) {
1;
}
Will cause them to run once.
--
http://www.php.net/manual/en/control-structures.declare.php
http://master.php.net/manage/user-notes.php?action=edit+20010
http://master.php.net/manage/user-notes.php?action=delete+20010
http://master.php.net/manage/user-notes.php?action=reject+20010