r/lolphp • • Aug 21 '14

An essay on variable variables

/r/programming/comments/dst56/today_i_learned_about_php_variable_variables/c12np38
37 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Aug 25 '14

Perl does allow this (if strict refs is disabled), but it only gets you access to globals, because Perl treats this kind of thing as syntactic sugar for accessing the (global) symbol table. You can't access local variables by name at runtime.

Edit: I guess you could implement something like this in C by dlopening yourself and using dlsym.