Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20901 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90157 invoked by uid 1010); 30 Nov 2005 16:17:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 90142 invoked from network); 30 Nov 2005 16:17:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2005 16:17:46 -0000 X-Host-Fingerprint: 194.109.193.120 unknown Linux 2.4/2.6 Received: from ([194.109.193.120:36179] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 17/7D-14828-AA0DD834 for ; Wed, 30 Nov 2005 11:17:46 -0500 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id 1510218741D; Wed, 30 Nov 2005 17:17:46 +0100 (CET) Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05652-12; Wed, 30 Nov 2005 17:17:44 +0100 (CET) Received: from [192.168.1.16] (bspr.xs4all.nl [194.109.161.228]) by mx1.moulin.nl (Postfix) with ESMTP id 824BE1871D8; Wed, 30 Nov 2005 17:17:44 +0100 (CET) Message-ID: <438DD0A3.6000908@iamjochem.com> Date: Wed, 30 Nov 2005 17:17:39 +0100 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sara Golemon Cc: "Dmitry Stogov" , internals@lists.php.net References: <2B.E1.14828.4130D834@pb1.pair.com> <000001c5f584$77823f80$e902a8c0@thinkpad> <002c01c5f5bf$f55e8c20$7d051fac@stumpy> In-Reply-To: <002c01c5f5bf$f55e8c20$7d051fac@stumpy> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at moulin.nl Subject: Re: [PHP-DEV] Labeled Break (nothing at all whatsoever to do with GOTO) From: jochem@iamjochem.com (Jochem Maas) Sara Golemon wrote: ... > 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..." > I wonder if the need for labelled breaks/continues might dissapear (in practice) if those people who could most do with them are given 'goto' (without the no-go-backwards limitation) instead? Everytime I see heavily nested 'break n' statements it makes me wince and the only times there seems to be no real/decent alternative to such nesting is when building some kind of state machine ... state machines being one of the few concrete examples to support the implementation of 'goto' in the first place, no? ... > 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... devils advocate: what happens when I want to place a 'goto' label just before a while or foreach loop (upon which I haven't put a label)? I ask because I assume that the following 2 statements should be identical no:? > 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