Re: Construct Request
| From: | Andi Gutmans | Date: | Thu, 15 Apr 2004 21:37:46 +0000 |
| Subject: | Re: Construct Request | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9239@lists.php.net to get a copy of this message | ||
At 02:21 PM 4/15/2004 -0400, Sean Coates wrote:
Andi Gutmans wrote:I have to read closer next time. Personally I prefer finding a user-land solution and not a new syntax. All these "weird" operators look like all of the weird Perl stuff. AndiIt 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).What seems right to me: <?php $variable = $foo ?: $bar; // is the same as if ($foo) $variable = $foo; else $variable = $bar; ?>$bar ? : $baz; If $bar evaluates to true, the expression evaluates to $bar or to 0, respectively.I think we're unclear on this..