Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4057

Re: a perl guy question; next label? continue label?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From "Peter H. Coffin" <hellsop@ninehells.com>
Newsgroups comp.lang.php
Subject Re: a perl guy question; next label? continue label?
Date Mon, 12 Dec 2011 15:33:00 -0600
Organization A noiseless patient Spider
Lines 29
Message-ID <slrnjecsoc.51n.hellsop@nibelheim.ninehells.com> (permalink)
References <daf31c1e-2cbb-4141-a2a6-b85806c14005@q9g2000yqe.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info mx04.eternal-september.org; posting-host="le/2G4+BNpieVhQI6uJ2Lw"; logging-data="32349"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lh2tABgrrMgIXH0e90kfj"
User-Agent slrn/0.9.9p1 (OpenBSD)
Cancel-Lock sha1:ulMyhS+B9XJX9Yed8hxkLkwQqSE=
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:4057

Show key headers only | View raw


On Mon, 12 Dec 2011 12:41:32 -0800 (PST), oldyork90 wrote:
> It doesn't appear the php has a continue label construct as in (perl)
>
>:outer for(.......
>    :inner for (....
>       if (...) {
>           next outer;
>
> Is that correct?

It does have, sort of. It is, shockingly, called "continue".

PHP-wise, the above would be

for (...) {
    for (...) {
	if (...) {
	    continue 2;
	}
	// This part is skipped by the continue 2 (or continue 1, 0
	// or continue all by itself).
    }
    // This part is ALSO skipped by the continue 2 above, but would 
    // execute if continue 1, 0, or continue alone were used.
}

-- 
Whenever you look at a beautiful woman,
always remember that somewhere, someone is tired of her.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

a perl guy question;  next label?  continue label? oldyork90 <oldyork90@yahoo.com> - 2011-12-12 12:41 -0800
  Re: a perl guy question;  next label?  continue label? "Peter H. Coffin" <hellsop@ninehells.com> - 2011-12-12 15:33 -0600
    Re: a perl guy question; next label? continue label? oldyork90 <oldyork90@yahoo.com> - 2011-12-12 17:38 -0800
      Re: a perl guy question; next label? continue label? "Peter H. Coffin" <hellsop@ninehells.com> - 2011-12-13 07:26 -0600
        Re: a perl guy question; next label? continue label? Tim Streater <timstreater@greenbee.net> - 2011-12-13 14:57 +0000
          Re: a perl guy question; next label? continue label? The Natural Philosopher <tnp@invalid.invalid> - 2011-12-13 19:44 +0000
            Re: a perl guy question; next label? continue label? Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-12-14 14:02 +0100

csiph-web