Re:Bug #48669: PHP now includes GOTO
by wvenable on Friday August 21, 2009 @05:21PM
(#778496)
PHP is ubiquitous, and now I can be more easily targeted by languages that can compile to PHP. They must have had a use-case in mind when adding it, because it's a lot of work for nothing otherwise.
[ Parent
| on HN ]
Re:Bug #48669: PHP now includes GOTO
by mnemonicsloth on Friday August 21, 2009 @05:33PM
(#778523)
The standard Acceptable Goto is used to throw control between levels of a multiply-nested loop.
See also: call/cc for managing control flow in a tangle of mutually recursive functions.
But it's not "a lot of work" to implement at all!
All of the standard 'structured programming' constructs (if, while, for, switch, etc.) are just wrappers around conditional jumps in nearly every imperative language. switch even uses labels for fuck's sake!