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 <n> in that now needs to be a break
<n+1>. 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