Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PHP example on variable variables - without needing them
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