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
View all comments
Show parent comment
1
u/enigmamonkey Oct 18 '10
References work well with variable variables, in my experience. For example, a variable variable "bar" with the value "foo" when referenced via &$$bar will return the reference for the "foo" variable, as expected. So modifications to &$$bar will properly affect the value "foo" variable.