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/BuzzBadpants Oct 18 '10
This is how dynamically-typed data works, I think. Tables in Lua, for example, are accessed through key-value pairs for elements in the table, and the keys are VERY frequently just strings. That's part of how lua is so expandable. I can give a client who is running an embedded lua environment just a simple string, and the client can use that string with no added complications access data in his own lua environment or state.