Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22200 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99193 invoked by uid 1010); 7 Mar 2006 15:08:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99177 invoked from network); 7 Mar 2006 15:08:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2006 15:08:01 -0000 X-Host-Fingerprint: 69.64.38.41 bluga.net Linux 2.5 (sometimes 2.4) (4) Received: from ([69.64.38.41:33378] helo=bluga.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 70/20-22029-FC1AD044 for ; Tue, 07 Mar 2006 10:07:59 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by bluga.net (Postfix) with ESMTP id 1BA0621CB5A; Tue, 7 Mar 2006 10:01:52 -0600 (CST) Received: from bluga.net ([127.0.0.1]) by localhost (bluga.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29988-02; Tue, 7 Mar 2006 10:01:52 -0600 (CST) Received: from [192.168.0.101] (CPE-24-208-79-238.neb.res.rr.com [24.208.79.238]) by bluga.net (Postfix) with ESMTP id C42FC21CB54; Tue, 7 Mar 2006 10:01:51 -0600 (CST) Message-ID: <440DA26F.5010109@php.net> Date: Tue, 07 Mar 2006 09:10:39 -0600 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051128) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Stogov CC: internals@lists.php.net References: <000001c641c9$80dbfad0$6e02a8c0@thinkpad> In-Reply-To: <000001c641c9$80dbfad0$6e02a8c0@thinkpad> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at bluga.net Subject: Re: GOTO and/or BREAK LABEL From: cellog@php.net (Greg Beaver) 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 For what it is worth: 1) +0.5 2) +1 3) +0 4) -1 I don't see any real benefit to break label as the deepest I have ever seen is 3 levels of break. I have run up against too many situations where the only way to lex something effectively in PHP is with pcre. The ability to port a tool like re2c would make it far easier to do things efficiently without having to write a new PHP extension. I doubt any users will suddenly start peppering goto all over their source, I just can't see that happening when there are so many other great loop constructs available. Discouraging its use is easy - just make sure the manual makes it really unattractive and has examples of better ways to implement goto using for/foreach/while. Greg