Combined assignment operator for short ternary
| From: | Sebastian Krebs | Date: | Fri, 17 Aug 2012 21:41:56 +0000 |
| Subject: | Combined assignment operator for short ternary | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-62228@lists.php.net to get a copy of this message | ||
Hi,
Don't know, how complicated this is (and also someone (not me) must implement it, because I can't :X), but to be in sync with the operators the short ternary operator should be usable in conjunction with the assignment like the other binary operators. Don't know, if anybody understands me :D So here is an example
// instead of
$foo = $foo ?: 'default';
// Just
$foo ?:= 'default';
I have many of this "default assigments" and yes: This is just syntactic sugar.
Regards,
Sebastian