PHP 4.0 Bug #8150 Updated: extending call_user_func()'s functionality
| From: | sterling@php.net | Date: | Thu, 07 Dec 2000 09:53:37 +0000 |
| Subject: | PHP 4.0 Bug #8150 Updated: extending call_user_func()'s functionality | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40336@lists.php.net to get a copy of this message | ||
ID: 8150
Updated by: sterling
Reported By: sbergmann@php.net
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
use the call_user_func_array() function.
// somefunc() a useless wrapper around
// some_other_func()....
function somefunc()
{
$args = func_get_args();
$ret = call_user_func_array("some_other_func", $args);
return($ret);
}
call_user_func_array() is in the latest CVS or PHP 4.0.4 and up
Previous Comments:
---------------------------------------------------------------------------
[2000-12-06 23:36:58] sbergmann@php.net
Imagine the following situation:
function foo()
{
// get arguments for call of foo()
$arg_list = func_get_args();
// call another function, depending on $arg_list
// and passing parts of $arg_list as parameters
call_user_func( "bar", /* how can i put here a
variable number of
arguments? */
);
}
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8150