Dmitry Stogov wrote:
Hi,
Because of some confused people I reverted "break label" patch and post it
for discussion once again together with GOTO patch.
Please reviw and vote.
1) goto and break label
2) goto only (like C)
3) break label only (like Java)
4) nothing
My vote: (1) +0.5, (4) +0.5
Thanks. Dmitry.
I'm not concerned by the vote.
"break" should be consistant with "continue"
so break labels could only be "like Java".
if confused with "goto", what are labels then ?
the case is very well shown by someone in the list, can't find the post
back, as:
etiquette: while (...) {
...
break etiquette; // breaks loop, next after the }
...
continue etiquette; // continues loop, next after the {
...
goto etiquette; // breaks and restarts loop
...
}
I can see what the 3 do with respect to any vote conclusion here.
Mixing "goto" with "break" and "continue" could bring confusion.
Not necessarly if established that goto will break any loop up to the
one where the target is.
Assuming labels can also be applied to non "loop" constructs, then goto
should break all loops up to the loop labeled by etiquette or containing
etiquette on its direct level.
Finally, I see goto as a nightmare, here.
Last troll's note:
goto has 2 "O" as Object Oriented
--
toggg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php