Please note that the ternary operator is a statement, and that it
doesn't evaluate to a variable, but to the result of a statement. This
is important to know if you want to return a variable by reference.
The statement return $var == 42 ? $a : $b; in a return-by-reference
function will therefore not work and a warning is issued in later PHP
versions.
So there is a problem with the return-by-reference for the ?: syntax.
That's way I explicitly wrote what should be returned.
参照サイトhttps://groups.google.com/forum/#!msg/doctrine-user/qbSAvaKH5uI/DF_2XSxFvG4J
があったとは言えませんがbug
、URLhttps ://bugs.php.net/bug.php ?id=60169からはbug
there is also segfault in (***)?:value notation.
like:
<?php
$str = array('test');
list($a, $b) = is_array($str)?:$str;
and this make *the patch doesn't work* (a memory leak)