Re: Assignment operator proposal

From: Date: Wed, 20 Mar 2002 23:51:12 +0000
Subject: Re: Assignment operator proposal
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-89434@lists.php.net to get a copy of this message
From: "Enrico Weigelt" <weigelt@metux.de> > On Thu, Mar 21, 2002 at 12:36:26AM +0200, Bogdan Stancescu wrote: > > > Hi all! > > > > I'd like to hear from a single one of you who isn't tired of code similar to > > i'm solving this with some little knowledge of shortcuts evaluation ... > > > <? > > if (!$whatever) { > > $whatever=something; > > } > > ?> > > (($whatever) || ($whatever = something)); > > > or else > > > > <? > > if ($whatever) > > { > > $somethingelse=$whatever; > > } > > ?> > (($whatever) && ($somethingelse=$whatever)); > > > How about a new asignment operator which would shut up all those Python > > enthusiasts - let's say the new operator would be caret - and we could > > replace the first example with > sounds interesting. > > IMHO you have to rewrite some stuff in the php language parser > so it detects these expressions and generates an if-else-tree ... Please note, there are many German PHP developers. Most of them are not so stupid ... -Egon

« previous php.general (#89434) next »