Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20884 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93111 invoked by uid 1010); 30 Nov 2005 09:24:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93096 invoked from network); 30 Nov 2005 09:24:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2005 09:24:34 -0000 X-Host-Fingerprint: 195.225.34.5 fw01.axit.nl Received: from ([195.225.34.5:24844] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1B/E4-14828-2DF6D834 for ; Wed, 30 Nov 2005 04:24:34 -0500 Message-ID: <1B.E4.14828.2DF6D834@pb1.pair.com> To: internals@lists.php.net References: <2B.E1.14828.4130D834@pb1.pair.com> Date: Wed, 30 Nov 2005 10:24:14 +0100 Lines: 59 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Posted-By: 195.225.34.5 Subject: Re: Labeled Break (nothing at all whatsoever to do with GOTO) From: r.korving@xit.nl ("Ron Korving") I'd say: foreach ($arr as $val) as foo { if (true) break foo; } I don't like the idea at all that labeled breaks are in any way connected to 'goto' usage. It's my opinion that the two can coexist without a problem, and that's how I would prefer to see it being used. Besides, BAR:while () { } would not do well with a future goto-implementation, because that would mean it would jump to the beginning of the loop, and not out of the loop. Maybe you mean to say that labels for goto and break can exist in the same collection, but I wouldn't be a fan of that at all. Semantically, 'goto' behavior is very different from break-behavior. With a break I expect to leave a certain construct that has a certain name, with goto I expect to jump to the line of code that was labeled with a name. I think the usage is different enough not to want those labels to be the same kind of things. Maybe other people disagree, but my point is that the difference in semantics is really something to consider. When you make break-labels the same as goto-labels, I would find this a bit weird to read: FOO: while (true) { ... } Will it be used for breaking out of the loop or for jumping to the loop? Should I expect a goto statement somewhere in this file? - Ron "Bart de Boer" schreef in bericht news:AA.64.14828.88C6D834@pb1.pair.com... > Sara++ :) > > Although I prefer BAR:while (This would go better with goto if someone > would want to implement that some day.) I'd settle for while BAR since I > don't care about goto anyway. > > So: > > foreach BAZ ($arr as $val) +1 > > > BAZ: foreach ($arr as $val) +2 > > > foreach as BAZ ($arr as $val) -2 ('as' can be a bit confusing here)