From: [EMAIL PROTECTED] Operating system: All PHP version: 4.1.2 PHP Bug Type: Feature/Change Request Bug description: func_get_arg(), func_get_args() should be reference proof
The function func_get_arg() and func_get_args() should support being called to return references: function do_something() { $args = func_get_args(); for ($i=0; $i<count($args); $i++) { do_something_with($args[$i]); } } $ref = new Object(); do_something(&$ref, "String", 0, 1.5); This function could register a dynamic number of variables to the session (references for the Object!!!), create an array or simple call another function with exactly the same arguments. I think it should be no problem for func_get_arg[s]() to save references passed to the function. Like function x($arg1, $arg2) { $args = array(&$arg1, &$arg2); } saves $arg1 and $args by reference if they are passed by reference or by value if they are passed by value. Thank you, looking forward to the new object model in Zend 2!!! Ferdinand Beyer <[EMAIL PROTECTED]> -- Edit bug report at http://bugs.php.net/?id=16464&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16464&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16464&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16464&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16464&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16464&r=support Expected behavior: http://bugs.php.net/fix.php?id=16464&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16464&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16464&r=submittedtwice