Re: Control Structure Syntax Question
| From: | Michal Migurski | Date: | Wed, 10 Mar 2004 15:56:55 +0000 |
| Subject: | Re: Control Structure Syntax Question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180027@lists.php.net to get a copy of this message | ||
>$x ? xxx : xxx
>
>But it makes your code less readable IMHO and offers no tangible benefit
>whatsoever.
It offers the tangible benefit of evaluating to something:
return (isset($foo) ? $foo : $bar);
$query = "select * from foo"
.(isset($bar) ? " where bar = ${bar}" : '');
$foo = ((count($bar) > 1) ? 'bars' : 'bar);
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html