Re: PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement
| From: | Rasmus Lerdorf | Date: | Sat, 06 Jan 2001 04:38:34 +0000 |
| Subject: | Re: PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-43109@lists.php.net to get a copy of this message | ||
Yes, I am sure it is an oversight. This should work as in C where the
continue breaks out of the innermost loop, and a switch is not a loop.
Not sure it is something we should change in a minor version though.
-Rasmus
On Fri, 5 Jan 2001, Zak Greant wrote:
> Cynic wrote:
> > Um, I don't know. This looks to me like trying to hide problems/
> > inconsistencies/bugs too easily. :) I think it should stay in
> > the bug realm.
> > I, just like the other guy, consider this a bug. What good
> > is continue within switch if it's the same as break, while it's
> > clearly (meant to be) something different? It could as well
> > trigger an error: 'use break instead'.
>
> We should ask the core developers how they want continue +
> switch to work. I would guess that it was an oversight when
> they were writing the language parser, but you never know...
>
> If it comes to group concensus, my vote is to change switch
> to handle continue like if.
>
> The reason that I classed it as a feature request is because
> switch + continue has behaved in this way for a long time.
>
> The behavior the user wants can be achieved with a minor
> modification to their code. However, if PHP gets changed
> to accomodate the behavior that the user wants, then other
> people may have to change their code.
>
> Just my 0.02 cents
>
> --zak
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>