|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-02-06 07:53 UTC] 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.
*/
Patchesfunc-get-args-with-offset (last revision 2010-03-06 11:50 UTC by kalle@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 15:00:01 2025 UTC |
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; }