note 50100 deleted from language.control-structures by bjori
| From: | bjori@php.net | Date: | Wed, 26 Apr 2006 15:44:18 +0000 |
| Subject: | note 50100 deleted from language.control-structures by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-109759@lists.php.net to get a copy of this message | ||
Note Submitter: dotwho at nospam dot mac dot com
----
As of php 5.01:
if using the short cut if - else syntax:
condition ? true : false;
be careful. inside of condition the and / or operators do not work as expected. use instead
&& / ||.
Example:
<?php
$sText = (!isset($searchText) or $sText === "" ? "NULL" : $sText);
?>
Always sets $sText to "1".
<?php
$sText = (!isset($searchText) || $sText === "" ? "NULL" : $sText);
?>
Sets $sText appropriately.