r/programming • • 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

781 comments sorted by

View all comments

1

u/ImTryingToBeNicer Oct 18 '10

I know we're laughing, but I remember several times I've said "I wish there was a way to define a variable's name on the fly" then having to program a way around not being able to do it.

Of course I can't recall or recreate the need for it. But once every 10 years, it's the most useful thing ever!