note 55473 deleted from language.expressions by sean

From: Date: Thu, 04 Aug 2005 20:07:51 +0000
Subject: note 55473 deleted from language.expressions by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-93097@lists.php.net to get a copy of this message
Note Submitter: runcz at netparks dot lv ---- This might be pretty obvious to some experienced coders or programmers,but maybe it can save a few minutes to someone. The "if" statement from the following code (in case, if "else" statement is not needed): <?php $foo=true; if(isset($foo)) echo "something"; ?> cannot be converted to something equal, using ternary conditional operator, as it is required to use the "$third" expression or "else" statement equivalent in it. so, the following code: <?=(isset($foo)) ? "something";?> or <?=(isset($foo)) ? "something":;?> returns parse error, no matter if you use echo() or "<?= ?>" syntax.

« previous php.notes (#93097) next »