Re: Re: goto label

From: Date: Tue, 09 Dec 2003 05:51:27 +0000
Subject: Re: Re: goto label
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-172231@lists.php.net to get a copy of this message
Robert Cummings wrote:
On Tue, 2003-12-09 at 00:32, Justin Patrin wrote:
Nitin wrote:
Hi all, I was wondering, if there's any way to achieve 'goto "label":' using PHP Thanx for ur time Nitin
goto is a very old and broken way of coding. If you ever find yourself in need of a goto, you should re-evaluate how you're doing things. If you're having trouble finding out how to do it better, just ask here. :-)
Goto <line number> is a very broken way of coding. Goto <label> is a very useful and structured way of coding especially when creating fast FSMs for parsing. I was a little disappointed a few months ago when I found that PHP didn't support the goto label syntax since it would have provided the most elegant solution. Cheers, Rob.
goto anywhere is broken. For instance, goto-ing out of loops and functions, or into one function from another causes untold grief to the language developer and makes it very hard to read the code. Then there's using goto into and out of class functions, which is even worse. In truth, goto has no place in a higher level programming language. Anything that can be done with goto can be done without it and (IMHO) more elegantly. -- paperCrane <Justin Patrin>

« previous php.general (#172231) next »