Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11687 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67053 invoked by uid 1010); 30 Jul 2004 18:07:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67018 invoked from network); 30 Jul 2004 18:07:06 -0000 Received: from unknown (HELO mrelay-a.lmu.ac.uk) (160.9.128.16) by pb1.pair.com with SMTP; 30 Jul 2004 18:07:06 -0000 Received: from localhost.lmu.ac.uk ([127.0.0.1] helo=localhost) by mrelay-a.lmu.ac.uk with esmtp (Exim 4.30) id 1Bqblf-0002Fb-4Z for internals@lists.php.net; Fri, 30 Jul 2004 19:06:07 +0100 Received: from mrelay-a.lmu.ac.uk ([127.0.0.1]) by localhost (mrelay-a [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04051-02 for ; Fri, 30 Jul 2004 19:06:05 +0100 (BST) Received: from lis-exchange2.lmu.ac.uk ([160.9.35.2]) by mrelay-a.lmu.ac.uk with esmtp (Exim 4.30) id 1Bqbkp-0002F2-Kw for internals@lists.php.net; Fri, 30 Jul 2004 19:05:15 +0100 Received: by lis-exchange2.lmu.ac.uk with Internet Mail Service (5.5.2653.19) id ; Fri, 30 Jul 2004 19:04:58 +0100 Message-ID: <0EEFC4D3CBE8A142868E396381B77A53D1267D@lis-exchange3.lmu.ac.uk> To: internals@lists.php.net Date: Fri, 30 Jul 2004 19:04:59 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by McAfee at Leeds Metropolitan University Subject: RE: [PHP-DEV] GOTO operator From: M.Ford@leedsmet.ac.uk ("Ford, Mike [LSS]") On 30 July 2004 18:45, Andi Gutmans wrote: > At 10:32 AM 7/30/2004 -0700, Sara Golemon wrote: > > > Secondly, I just don't understand what the sudden necessity for > > > the goto construct is when over the years we have barely ever had > > > a PHP developer asking for it. > > > > > We clearly travel in different circles. I've heard GOTO requested > > at least monthly from a different person each time and have never > > heard someone say "I can't wait till PHP5 is ready so I can use > > exceptions". > > I guess so, because I haven't hear the former but have heard the > latter :) > > Anyway goto tends to be used mostly when you need a double or triple > break, which is no problem with PHP as it is. Well, it *is* a problem in that (i) you have to count the levels in the first place and (ii) if you add another level somewhere in between, you have to *remember* that you've got that break in that now needs to be a break . I've been bitten by this a couple times and spent a good few hours debugging it each time (yes, I do write monster loops!). (This has also been mentioned in a Feature Request (not mine!): http://bugs.php.net/bug.php?id=29287) I'm just about +0 on goto, but if the part of this patch that allows labelled statements could also be applied to provide a labelled break, I'd be +several gazillion for that!! Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211