Re: PHP 5.1

From: Date: Mon, 06 Jun 2005 16:40:50 +0000
Subject: Re: PHP 5.1
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-16450@lists.php.net to get a copy of this message
Quoting Rasmus Lerdorf <rasmus@lerdorf.com>:
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

« previous php.internals (#16450) next »