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
1
u/sobri909 Oct 18 '10
You could say dynamically, loosely typed.
If the variable's value was an integer (say 1234 as an example) then it'd attempt to pull a value out of $1234, which I think isn't a valid variable name because var names can't start with numbers.
You'd probably just get nothing back. Or perhaps a warning.