Re: [RFC][PRE-VOTE] In Operator
| From: | Mike Willbanks | Date: | Mon, 16 Mar 2015 14:12:53 +0000 |
| Subject: | Re: [RFC][PRE-VOTE] In Operator | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85057@lists.php.net to get a copy of this message | ||
On Sun, Mar 15, 2015 at 10:07 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> 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.
>
I had made this point earlier; not having it was not in particular a hurdle
for me but I did believe that if we added the in clause we could also
follow that type of for loop.