while reading about declare construct from php manual i tried the following example
using wamp server<?php
declare(ticks=1);
// A function called on each tick event
function tick_handler()
{
echo "tick_handler() called\n";
}
register_tick_function('tick_handler');
$a = 1;
if ($a > 0) {
$a += 2;
print($a);
}
?>
i got the following error message "The connection to the server was reset while the page was loading.". 1)i am using firefox a开发者_如何学Cs browser?how can i resolve this problem?
Ticks are dependent on the web server that's running PHP, the version of PHP and other PHP modules installed. From the docs:
register_tick_function() should not be used with threaded web server modules with PHP 5.2 or lower.
If you're using PHP 5.3+ the code sample should run fine. (I'm running 5.3 and the sample performs as promised). Otherwise, check your web server config.
精彩评论