Hi!

> Do you mean that this code would be valid in both PHP 7 and PHP 8, but
> mean different things?
> 
> while($outer) {
>     while($inner) {
>         switch($foo) {
>             case 1:
>                 continue 2;
>         }
>     }
> }
> 

I think this would be unacceptable, because WTF potential and subtle
code breakage that would result would be huge. If there are several
wrapped loops, it'd be almost impossible to detect that you're now
breaking a wrong loop. I think the only thing that could be changed is
"continue;" - without an argument - and the thing that should happen is
a notice that it may not do what you (might) think it's doing. If you
use something like "continue 2;" I would assume you know what you're
doing, this is a PHP-specific construct so it is reasonable to assume
you checked it does what you think it does.

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to