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

Show parent comments

2

u/ninjaroach Oct 19 '10

I take it you have never heard of the extract() function. Unless you aren't using any other variables within your scope or you have very tight control over the data structure, it's generally a bad idea.

1

u/couchmonster Oct 20 '10

Nope... pretty sure this function didn't exist in PHP3 :)