Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20898 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55676 invoked by uid 1010); 30 Nov 2005 15:06:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55661 invoked from network); 30 Nov 2005 15:06:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2005 15:06:14 -0000 X-Host-Fingerprint: 69.12.155.130 69-12-155-130.dsl.static.sonic.net Linux 2.4/2.6 Received: from ([69.12.155.130:3563] helo=pigeon.alphaweb.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 19/E8-14828-6EFBD834 for ; Wed, 30 Nov 2005 10:06:14 -0500 Received: from localhost ([127.0.0.1] helo=stumpy) by pigeon.alphaweb.net with smtp (Exim 4.10) id 1EhSjg-0004iH-00; Wed, 30 Nov 2005 06:15:04 -0800 Message-ID: <002c01c5f5bf$f55e8c20$7d051fac@stumpy> To: "\"Dmitry Stogov\"" Cc: References: <2B.E1.14828.4130D834@pb1.pair.com> <000001c5f584$77823f80$e902a8c0@thinkpad> Date: Wed, 30 Nov 2005 07:08:23 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] Labeled Break (nothing at all whatsoever to do with GOTO) From: pollita@php.net ("Sara Golemon") > This "break LABEL" construct does exactly the same as "break NUM", > > May be I missed something? I didn't look into patch deep. > Your take is spot-on. This isn't an extension of functionality, just a "numbered breaks with a name" which is something I've heard requested from several corners (including @zend.com) as a "wouldn't it be nice..." > Also I don't like syntax for loops that you suggested. > I prefer "LABEL: while(1) {...}" instead of while LABEL (1) {...}". > I agree that the positioning of the label has an inherent ugliness to it. I avoided "LABEL: while (1) { }" however, in order to avoid conflicting with and complicating the GOTO discussion. Since (if goto was added as well) this syntax could create an ambiguity in what the label means. Since you'd like the label to be moved out of zend_brk_cont_element, then perhaps we can allow this syntax to pull double duty... LABEL: whlie(1) { break LABEL; <-- el->brk continue LABEL; <-- el->cont goto LABEL; <-- opline->u.opline_num break OTHERLABEL; <-- error continue OTHERLABEL; <-- error goto OTHERLABEL; <-- opline->u.opline_num } OTHERLABEL: nonBreakContainerStatement(); > This construct has logic and make sense, but I am not sure that we should > incrise complication of PHP compiler without any serious benefits. > Readability is the only one benefit of this patch. > So the question is: How serious is the gain in readability/maintainability? -Sara