Re: [RFC][PRE-VOTE] In Operator

From: Date: Mon, 16 Mar 2015 03:07:36 +0000
Subject: Re: [RFC][PRE-VOTE] In Operator
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-84977@lists.php.net to get a copy of this message
Hi Netroby, On Mon, Mar 16, 2015 at 12:03 PM, Netroby <hufeng1987@gmail.com> wrote: > Does the "in" support this kind of php code ? > > ```php > <?php > $arr = ['a', 'b', 'c']; > for ($v in $arr) { > echo $v; > } > > > ``` > > I know javascript has this kind of support > > > > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in > No. We have foreach for this. Shells support this syntax, too. It may be confusing for some users. Good point. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#84977) next »