ID: 50945 Comment by: kwilson at shuttlebox dot net Reported By: robert at binalan dot com Status: Open Bug Type: Feature/Change Request Operating System: FreeBSD PHP Version: 5.2.12 New Comment:
Why wouldn't you just use array_shift? The PHP folks don't seem to like to implement features when there is already an approach to accomplish the task in few steps: function moduleNotify($module, $message/*, ...args*/) { $data = array_shift(array_shift(func_get_args())); switch($module){ case 'Database': list($host, $user, $pass, $base) = $data; break; case 'UserLogin': list($user, $pass, $iris, $lang) = $data; break; } Previous Comments: ------------------------------------------------------------------------ [2010-02-06 07:53:23] robert at binalan dot com Description: ------------ function moduleNotify($module, $message/*, ...args*/) { switch($module){ case 'Database': list($host, $user, $pass, $base) = func_get_args(2); break; case 'UserLogin': list($user, $pass, $iris, $lang) = func_get_args(2); break; } /* feature request: func_get_args(offset=0) returns arguments in same zero based array from a given offset in the argument list. */ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50945&edit=1