Re: GOTO command. Doest it exist?

From: Date: Wed, 12 Jun 2002 04:32:19 +0000
Subject: Re: GOTO command. Doest it exist?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-101678@lists.php.net to get a copy of this message
In article <001901c21190$c2ffc4e0$0100007f@localhost>, hdanaher@earthlink.net says... > Many will tell you that the goto command is extinct. It isn't, it's just > evolved into the function command. What you do now is create a function: > > function some_name($variable,$other_variable,...) > { > some code here; > } > > then, call it using : > > call_user_func('some_name',$variable,$other_variable,...) > > It's just like goto, it goes to a specified code block and then returns to > the line below the call, but takes more typing. > Hope this helps. > Hugh What you have described is more like a gosub. Goto jumps execution to the specified point in the code and continues from there. It does not automatically return to the line after the goto call. -- David Robley Temporary Kiwi! Quod subigo farinam

« previous php.general (#101678) next »