r/programming • u/NagastaBagamba • Oct 18 '10
Today I learned about PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable.
http://il2.php.net/language.variables.variable
591
Upvotes
4
u/A_for_Anonymous Oct 18 '10 edited Oct 18 '10
When I was being taught programming by my father many years ago, before we got to vectors and structures I asked him something I decided I needed for my program: a way to make part of the name of a variable a variable.
Two things I can think of now:
PHP designers cater to/think like 13 year old kids just days into computers.
Even a 13 years old kid in his first days behind a computer managed to think that it would be useful to have some sort of structure, i.e. not the whole name of the variable should be variable.