# GOTO operator

- Thread: https://externals.io/message/11687
- Original archive: https://news-web.php.net/php.internals/11687
- Started by Ford on 2004-07-30T18:04:59+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #11687 — Ford — 2004-07-30T18:04:59+00:00

URL: https://externals.io/message/11687#11687

> At 10:32 AM 7/30/2004 -0700, Sara Golemon wrote:
> > […]
> 
> 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
