最近更新了 PHP 5.4 从 5.3 在使用等于条件快捷方式的变量时崩溃


Recently updated PHP 5.4 from 5.3 crashing when using variable equal to conditional shortcut

我正在使用带有PHP 5.4的Apache 2.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 语法怪癖做错了什么?

提前感谢!

[更新] 我使用 CLI 执行了该文件,脚本产生了所需的结果。

我已经尝试过使用 php 5.4 配置并且没有问题你应该看到 apache/php 日志