Re: Combined assignment operator for short ternary

From: Date: Fri, 24 Aug 2012 21:01:42 +0000
Subject: Re: Combined assignment operator for short ternary
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi,

Just want to push my thread ^^

Nobody interested? Too stupid? I need to learn C (:X)? Too complicated? To much impact (on something)? Too less sense? BC? Anything not mentioned here?

To point that out: I _don't_ want to change the behaviour, which means

| $foo['xy'] ?:= 'bar';

would trigger a notice like

| $foo['xy'] = $foo['xy'] ?: 'bar';

would do.

Regards,
Sebastian

Am 17.08.2012 23:41, schrieb Sebastian Krebs:
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


Thread (18 messages)

« previous php.internals (#62459) next »