Re: Spaghetti code...
| From: | Rasmus Lerdorf | Date: | Tue, 11 Jul 2000 04:31:47 +0000 |
| Subject: | Re: Spaghetti code... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5850@lists.php.net to get a copy of this message | ||
> Hey, I was looking in the manual and I couldn't find good ol' spaghetti-code
> functions like goto or whatever.. Are they not in PHP? or did I look them
> over somewhere?
>
> (yes, yes i know they are evil incarnate and nobody likes them and wants
> them band in all 50 states, but I'm still curious...)
No 'goto' but you do get break and continue, and both of these can take a
numerical argument specifying how many levels they should escape out
of. That can make some really nice spaghetti. So can the variable
variables. Or the variable variable variable variables... Or perhaps
variable variable variable functions?
eg.
function e() { echo "Hello World"; }
$a = "b";
$b = "c";
$c = "d";
$d = "e";
$$$$a();
-Rasmus