Re: Labeled Break (nothing at all whatsoever to do withGOTO)

From: Date: Wed, 30 Nov 2005 22:15:21 +0000
Subject: Re: Labeled Break (nothing at all whatsoever to do withGOTO)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-20914@lists.php.net to get a copy of this message
what happens when I want to place a 'goto' label just before a while or foreach loop (upon which I haven't put a label)? I ask because I assume that the following 2 statements should be identical no:? <?php LABEL: while(1) { /* ..etc */ ?> <?php LABEL: while(1) { /* ..etc */ ?> PHP's parser gives no importance to whitespace, so yes, these two are identical.
In the dual-purpose vision I had for these labels, all labels would be usable as GOTO targets. Labels which are followed *immediately* by a break container construct (for, foreach, while, do-while, switch) would also be usable as break/continue targets. Note that in these example, goto LABEL; and continue lABEL; are *not* the same statement. Goto would restart state loops such as for() and foreach() from initial positions. -Sara

« previous php.internals (#20914) next »