Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85406 invoked by uid 1010); 8 Mar 2006 14:21:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85391 invoked from network); 8 Mar 2006 14:21:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2006 14:21:08 -0000 X-Host-Fingerprint: 194.109.253.196 mediawave.xs4all.nl Received: from ([194.109.253.196:1293] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A0/DA-27106-358EE044 for ; Wed, 08 Mar 2006 09:21:07 -0500 To: internals@lists.php.net,Rasmus Lerdorf Message-ID: <440EE9B9.1070509@mediawave.nl> Date: Wed, 08 Mar 2006 15:27:05 +0100 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 References: <000001c641c9$80dbfad0$6e02a8c0@thinkpad> <11.E1.22029.BE55D044@pb1.pair.com> <440D56E0.9050200@lerdorf.com> In-Reply-To: <440D56E0.9050200@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 194.109.253.196 Subject: Re: [PHP-DEV] Re: GOTO and/or BREAK LABEL From: bart@mediawave.nl (Bart de Boer) Rasmus Lerdorf wrote: > Michael Wallner wrote: >> Dmitry Stogov wrote: >> >>> 1) goto and break label >> +0 >> >>> 3) break label only (like Java) >> +1 > > You do realize that this is: > > label: > while(condition) { > break label; > } > > As a C programmer this confuses me to no end. When I see "label:" I > expect control to end up there and the loop to be executed again. I > realize all the Java folks have gotten used to this, but I don't think I > ever will. > > -Rasmus If we do both goto and labeled breaks you can get your expected behaviour with: label: while(condition) { goto label; } right? Using break in the un-expected way together with goto gives you both options. FWIW (And that's probably not much ;) ) my vote would be: 1) 1 (goto and break label) 2) 0 3) 0 4) 0 Bart