Re: suggestion for IF / THEN / ELSE operator

From: Date: Wed, 22 Jan 2014 09:25:21 +0000
Subject: Re: suggestion for IF / THEN / ELSE operator
References: 1 2 3  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-18197@lists.php.net to get a copy of this message
On 22 January 2014 09:22, Alessandro Rosa <zandor_zz@yahoo.it> wrote: > Thanks for the prompt reply, Mike ! > > I will look over the RFC and try to write down one. > For an "in" operator, the following blog post might be useful to you: http://nikic.github.io/2012/07/27/How-to-add-new-syntactic-features-to-PHP.html > > Alessandro > > > > Il Mercoledì 22 Gennaio 2014 10:16, Mike Griffiths <mgriffiths@gmail.com> > ha scritto: > > > > On 22 January 2014 08:34, Alessandro Rosa <zandor_zz@yahoo.it> wrote: > > Hello, > > > >my name is Alessandro Rosa and I'm a PHP developer from Italy. > >Is there any chance for you to consider the development of the following > variation of the IF / THEN / ELSE ? > > > >if ( $_a in { 2, 3, 4 } ) > > > > > >where { 2, 3, 4 } is an array of values. > > > >Yes, I know I could supply it by creating an array and passing it to the > in_array() function, but sometimes > >it's quite fast to write such an expression above to be evaluated, > instead of creating an array, populating it > >then calling in_array for check. > > > >Thank you, > >Alessandro Rosa > Hi Alessandro, > > Looks to me like you want an RFC. Please take a look here: > https://wiki.php.net/rfc/howto > > -- > > > Mike Griffiths > > mgriffiths@gmail.com >

« previous php.webmaster (#18197) next »