我使用的是Apache 2.4和PHP 5.4。
我正在执行以下命令:
# retrieve caller name
$calledby = debug_backtrace(); print_r($calledby);
$caller = (strlen($calledby[1]['class'])) ? $calledby[1]['class'] : $calledby[0]['class'];
# arguments are required
if (!func_num_args()) { return; }
# fill variables with argument contents if exists
$variables = (func_num_args() == 0) ? NULL : (is_array(func_get_arg(0)) ? func_get_arg(0) : NULL);从类的私有方法中。
如果我注释掉$caller =和$variables =行,它就可以工作了。
如果我将我的代码更改为以下代码,它也可以工作(根据定义)
if (strlen($calledby[1]['class'])) $caller = $calledby[1]['class'];
else $caller = $calledby[0]['class'];我应该发布一个错误报告,还是我在一个新的5.4语法怪癖上做错了什么?
提前感谢!
UPDATE我使用CLI执行了该文件,脚本生成了所需的结果。
发布于 2012-05-03 22:44:22
我已经尝试过php 5.4配置,没有任何问题,您应该会看到apache / php日志。
https://stackoverflow.com/questions/10433047
复制相似问题