Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt

From: Date: Sat, 04 Mar 2006 00:36:10 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
References: 1 2 3 4 5 6 7  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4658@lists.php.net to get a copy of this message
At 04:31 PM 3/3/2006, Rasmus Lerdorf wrote:
I really don't think labelled breaks at this point is worth this confusion. If this is going to happen, it should be goto-like. Something like this: while() {
    my_while:
    ...
    foreach() {
       ...
       break my_while;
    }
} But then we are back to the all-out goto since you should be able to place the labels anywhere you want as long as you are not breaking into a deeper construct and only out of them, either forwards or backwards. And we don't seem to be able to agree on that. And I just re-read your point b) there and see that you said exactly the same thing, so yes, I agree with you. Did the goto patch let you use the label on a break as well?
Yeah but with the confusing semantics. I saw let's keep it simple. Screw labeled breaks/continue. My email was probably confusing but I meant we should do both (a) and (b) :) We will provide regular goto with the obvious limitation of not jumping into deeper constructs (which isn't relevant anyway). So your example would work if you do "goto my_while" instead of "break my_while". Andi Andi

« previous php.zend-engine.cvs (#4658) next »