1
<?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
}
4

1 回答 1

0

我不是 100% 确定您要做什么,但是

例如,在 Joomla 中更改页面底部的标签规定的页面底部 1)您必须下载托管转储脚本 2)找到旁边的一段 html 脚本代码 3)调查函数的行为 4)找到一个地方 html 代码教育 我只是在 $globals 和 register_tick_function 的帮助下找到了几个小时

听起来

如果您需要调试您的应用程序和/或需要查看以什么顺序和使用什么参数调用了哪些函数和方法,请使用适当的调试器:

https://stackoverflow.com/questions/1494288/good-free-php-debugger

非常感谢,但 hostmonster.com 中的 xdebug 已禁用

不想调试生产站点。如果您需要添加更多功能或应用更改,请先在您的开发服务器上执行此操作。确保它有效,然后将更改部署到您的生产站点。因此,要么将 XDebug 放在本地机器上,要么放在 VM 或类似的东西上。或者为您的开发环境获取一个新的主机。无论如何,把它放在开发和调试不会中断生产的地方。

于 2011-09-07T08:22:20.950 回答