Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Forked from anonymous/gist:1188637
Created September 2, 2011 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ircmaxell/1188649 to your computer and use it in GitHub Desktop.
Save ircmaxell/1188649 to your computer and use it in GitHub Desktop.
PHP example on variable variables - without needing them
<?php
function bar($a, $b, $c) {
$r = new ReflectionFunction(__FUNCTION__);
$params = func_get_args();
$form = array();
foreach ($r->getParameters() as $param) {
$form[$param->getName()] = array(
'#type' => 'hidden',
'#value' => $params[$param->getPosition()],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment