From 11749f70a36a3cb7c771ece5fa738233d3db14aa Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Thu, 13 Mar 2014 00:22:52 +0000 Subject: [PATCH] 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 --- language/operators.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/language/operators.xml b/language/operators.xml index ea6544106d..242b9184f9 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -1455,8 +1455,8 @@ if (empty($_POST['action'])) { - 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 return $var == 42 ? $a : $b; in a return-by-reference function will therefore not work and a warning is