Re: Labeled Break (nothing at all whatsoever to do withGOTO)
| From: | Jochem Maas | Date: | Thu, 01 Dec 2005 08:29:06 +0000 |
| Subject: | Re: Labeled Break (nothing at all whatsoever to do withGOTO) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20936@lists.php.net to get a copy of this message | ||
thanks for the explanation Sara, :-), as always your manner and ideas
are an example to the 'php core', 'we' (they) are lucky to have you :-)
Sara Golemon wrote:
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