Recently updated PHP 5.4 of 5.3 crashes when using variable equal to conditional shortcut

I am using Apache 2.4 with PHP 5.4.

I am doing the following:

# 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);

from a private class method.

If I comment on the lines $ caller = and $ variables =, then it works.

If I change my code to the following, it also works (AS DEFINED)

if (strlen($calledby[1]['class']))  $caller = $calledby[1]['class'];
else                                $caller = $calledby[0]['class'];

Should I report an error or am I doing something wrong with the new syntax 5.4?

Thanks in advance!

[UPDATE] I executed the file using the CLI, and the script created the desired result.

+3
source share
1 answer

I am trying with php 5.4 configuration and have no problems. You should see the apache / php log

0
source

All Articles