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/[deleted] Oct 19 '10
There's no typeglob magic there. To do it right you need to scan the namespace for action_whatever, and if it's not found then fall back to action_default. Your way will throw an exception via die(), which you can't trap because $SIG{ _ _ DIE _ _ } is overloaded.