PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable. And this is why I don't use PHP ;)
PHP: Variable variables - Manual
Printable View
PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable. And this is why I don't use PHP ;)
PHP: Variable variables - Manual
Nothing wrong with PHP if used correctly.
I've needed that functionality in the past. Glad PHP has it!
It is fun.
Code://You can even add more Dollar Signs
$Bar = "a";
$Foo = "Bar";
$World = "Foo";
$Hello = "World";
$a = "Hello";
$a; //Returns Hello
$$a; //Returns World
$$$a; //Returns Foo
$$$$a; //Returns Bar
$$$$$a; //Returns a
$$$$$$a; //Returns Hello
$$$$$$$a; //Returns World
//... and so on ...//
Things like that are the reason I love PHP so much for development; it's so damn flexible with its variables (I <3 no types) that you never end up digging through the manual to find the correct form for a datatype, or the function to typecast, you just get on with it. There's probably six different ways you could think of to do most things and PHP will probably let you code them all first time without too much hassle.
.Net, on the other hand... great for the 5% of projects that are real quick 'n' dirty, great for the 5% at the other end where you build your library up, but for the other 90% in the middle it never had the flexibility of PHP for me.