note 84391 rejected from language.operators.comparison by mgf
| From: | mgf@php.net | Date: | Mon, 14 Jul 2008 12:03:14 +0000 |
| Subject: | note 84391 rejected from language.operators.comparison by mgf | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141476@lists.php.net to get a copy of this message | ||
Note Submitter: irobeth at gmail dot com
----
An interesting note about the behavior of the ternary operator:
$sql = "not equals";
echo 'if' . ($sql === "equals") ? $sql .= " sql equals " : $sql =
" sql doesn't equal";
will produce $sql = "not equals sql equals"
I don't know why but my guess is the ternary executes both result and then returns whichever is
true, and that it does so on a stack.