Re: [PHP-DEV] PHP 4.0 Bug #8150: extending call_user_func()'sfunctionality From: Sebastian Bergmann (sb <email protected>)
Date: 12/07/00

sbergmann <email protected> wrote:
> 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? */
> );
> }

  Forgot to tell: The easiest way to implement this would be a

    call_user_func_array( $func_name, $func_args[] )

  function, that calls the function $func_name and gives $func_args[0] as
first argument, and so on.

-- 
  <? print implode( "", array_reverse( preg_split( "//", "dlrow laer "   .
  "eht ot emoclew" ) ) ); /* visit http://www.sebastian-bergmann.de/ */ ?>

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>