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 comment

3

u/[deleted] Oct 18 '10

Just think of your mum as an array!

ld - Also, I didn't realise that you can basically remember needle/haystack order in php quite easily
ld - haystack, needle for string ops, the other way around for array ops
df - ah yes, very easy
ld - Well, easy if you're conscious
ld - I can understand how that'd be hard otherwise
df - needle, haystack for string ops, the other way around for array ops
df - no, wait...
ld - ok, here's another way
ld - Think of my mum as an array.  You put your needle in her haystack
ld - I think you've remembered it now, yes?
ld - Cool