# The "jump" operator

- Thread: https://externals.io/message/36795
- Original archive: https://news-web.php.net/php.internals/36795
- Started by Arvids Godjuks on 2008-04-04T08:43:46+00:00
- Messages: 9
- 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

---

## #36795 — Arvids Godjuks — 2008-04-04T08:43:46+00:00

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

Link: http://news.php.net/php.internals/36536
One question - are you crazy? I heared about break with goto capabilities -
that's understandable - you could break 2 or 3 level loops, but this one
shit.

---

## #36797 — Alexey Zakhlestin — 2008-04-04T09:07:53+00:00

URL: https://externals.io/message/36795#36797 · In reply to: #36795

On Fri, Apr 4, 2008 at 12:43 PM, Arvids Godjuks
<arvids.godjuks@gmail.com> wrote:
> Link: http://news.php.net/php.internals/36536
>  One question - are you crazy? I heared about break with goto capabilities -
>  that's understandable - you could break 2 or 3 level loops, but this one
>  shit.

Could you please keep polite language?
Details of this construct were known for quite a long time, and it was
available in PHP6 for "ages"

it is a limited goto, just as advertised. you can get out of blocks
with it, but you can't go into blocks

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

---

## #36798 — Daniel T. Gorski — 2008-04-04T10:33:22+00:00

URL: https://externals.io/message/36795#36798 · In reply to: #36797

Hi,

> > […]

> it is a limited goto, just as advertised. you can get out of blocks
> with it, but you can't go into blocks

Shouldn't it be e.g. 'leave' instead of 'goto' then? Just to avoid confusion.

regards dtg

-- 
                            _
    ASCII ribbon campaign  ( )
     against HTML e-mail    X
                           / \

---

## #36799 — Arvids Godjuks — 2008-04-04T10:35:42+00:00

URL: https://externals.io/message/36795#36799 · In reply to: #36797

Well, why even add such functionality if it's doubtful it will be used. It
just ads confusion and anger to users, who knows what it does and what harm
can be done. GOTO functionality wasn't present in PHP and i think should
never be ever. break is fine..

2008/4/4, Alexey Zakhlestin <indeyets@gmail.com>:
>
> On Fri, Apr 4, 2008 at 1:17 PM, Arvids Godjuks <arvids.godjuks@gmail.com>
> wrote:
> > […]
> but
> > […]
> And it
> > […]
>
>
> break [1,2,3] is still there
>
> the following was removed
>
> $i = 2;
> break $i;
>
> while I, personnaly, agree, that for error-handling situations
> try/catch is a superior solution, the new "goto" construct can be
> useful for micro-optimizations
> I doubt, I will be using it, though :-)
>
> p.s. you replied me offlist. you should "cc" it, if you want to keep
> discussion running
>
>
> > […]
> this
> > […]
> --
>
> Alexey Zakhlestin
> http://blog.milkfarmsoft.com/

---

## #36800 — Jani Taskinen — 2008-04-04T10:41:06+00:00

URL: https://externals.io/message/36795#36800 · In reply to: #36799

You're about year too late..or even more. Please, don't just this
discussion now.

--Jani


> Well, why even add such functionality if it's doubtful it will be used. It
> just ads confusion and anger to users, who knows what it does and what harm
> can be done. GOTO functionality wasn't present in PHP and i think should
> never be ever. break is fine..
> 
> 2008/4/4, Alexey Zakhlestin <indeyets@gmail.com>:
> > […]
-- 
Patches/Donations: http://pecl.php.net/~jani/

---

## #36801 — Richard Quadling — 2008-04-04T11:02:58+00:00

URL: https://externals.io/message/36795#36801 · In reply to: #36800

> You're about year too late..or even more. Please, don't just this
>  discussion now.

Is there use case that can be used for the documentation?

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

---

## #36802 — Derick Rethans — 2008-04-04T11:18:15+00:00

URL: https://externals.io/message/36795#36802 · In reply to: #36801

> 
> > […]
> 
> Is there use case that can be used for the documentation?

http://youngbloods.org/essays/argument_for_goto.html has an IMO good 
example. It's java code, but it shows how goto can help you get rid of 
nesting hell.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

---

## #36803 — Edward Z. Yang — 2008-04-04T11:19:11+00:00

URL: https://externals.io/message/36795#36803 · In reply to: #36801

Richard Quadling wrote:
> Is there use case that can be used for the documentation?

Two big ones I can think of: Multi-loop breaks and parsers.

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

---

## #36815 — Jeff Moore — 2008-04-05T18:42:55+00:00

URL: https://externals.io/message/36795#36815 · In reply to: #36802

> http://youngbloods.org/essays/argument_for_goto.html has an IMO good
> example. It's java code, but it shows how goto can help you get rid of
> nesting hell.

Hi Derick,

The code in that example looks more like an argument for try ...  
finally to me than an argument for goto.  I have yet to see a good  
case for goto (not break) that doesn't involve parsing or error  
handling, and we have exceptions already for error handling flow  
control.  But, we don't have try ... finally (and java doesn't have  
goto).

Best Regards,

Jeff
