Ternary is an expression, not a statement. Patch by Alok Menghrajani.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332978 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2014-03-13 00:22:52 +00:00
parent d06d3727d5
commit 11749f70a3

View file

@ -1455,8 +1455,8 @@ if (empty($_POST['action'])) {
</para>
<note>
<simpara>
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
Please note that the ternary operator is an expression, and that it
doesn't evaluate to a variable, but to the result of an expression. This
is important to know if you want to return a variable by reference.
The statement <literal>return $var == 42 ? $a : $b;</literal> in a
return-by-reference function will therefore not work and a warning is