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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php