Re: Construct Request
| From: | Sean Coates | Date: | Thu, 15 Apr 2004 18:21:01 +0000 |
| Subject: | Re: Construct Request | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9208@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
It could be implemented but I don't see the big advantage over $bar ? 0 : $base It's one character... oes to GCC and its C extension).I think we're unclear on this.. What seems right to me: <?php $variable = $foo ?: $bar; // is the same as if ($foo) $variable = $foo; else $variable = $bar; ?> I know that's not what Sascha originally wrote, but am I mistaken on the actual meaning (I don't get the "0" reference made by Sascha)? S$bar ? : $baz; If $bar evaluates to true, the expression evaluates to $bar or to 0, respectively.