Quoting Rasmus Lerdorf <[EMAIL PROTECTED]>:
Personally I am quite ambivalent about adding goto. What I am not
ambivalent about is adding anything that will be a nightmare to support.
If the goto patch can be done in such a way that there is absolutely no
way that it will cause weird stack corruptions or other scope issues
when people use it incorrectly then I don't mind. People will use it
incorrectly just like they use all sorts of other features incorrectly,
but if it causes PHP to blow up or lose track of its scope, then I say
we leave it out. Some examples:
while(a) {
goto c;
while(b) {
c:
break 1;
}
}
Will that break out of the outer loop? Or slightly simpler:
c:
while(a) {
if(b) goto c;
break 1;
}
Am I 1 or 2 levels deep in that while loop once I enter it again after
the goto?
-Rasmus
So, it should not be possible
- to jump to a label which is declared before the actual goto statement.
- to jump in a block which is on a level deeper than the current one (here
should be handled that that jumping into another block on the same
level should
be forbidden)
Andrey
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php