<?php
declare(ticks=1);
function tick_handler()
{
print($GLOBALS['a']);
}
register_tick_function('tick_handler');
function test()
{
$a = 1;//This not print
$a = 2;//This not print
$a = 3;//This not print
$a = 4;//This not print
}
test();
$a = 1;//This print
$a = 2;//This print
$a = 3;//This print
$a = 4;//This print
?>
如何打印 //这不是打印,而是没有全局 $a ?
并且没有
function test()
{
$GLOBALS['a'] = 1;//This not print
$GLOBALS['a'] = 2;//This not print
$GLOBALS['a'] = 3;//This not print
$GLOBALS['a'] = 4;//This not print
}