Re: PHP 5.1
| From: | Ilia Alshanetsky | Date: | Tue, 07 Jun 2005 13:21:51 +0000 |
| Subject: | Re: PHP 5.1 | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-16519@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
GS>>Perl's goto specifically forbids jumping into control structures that GS>>require intialization (for instance, foreach()). That seems like a GS>>sensible limitation to me. jumping out is no good either.If jumping in/out of foreach is the only technical problem posed by GOTO, surely we can come up with a bit of code to address it. In response to the earlier question about the situations requiring goto, here is a small list: 1) Any state machine parser, such as the one frequently found in templating systems. Using goto "alternatives" makes code quite cumbersome and not to mention slow. 2) Code flow control for error handling. 3) A faster & safer alternative to recursive loops in many situations such as tree drawing algorithms. Ilia