mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
d06d3727d5
commit
11749f70a3
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue