Re: Passing an indefinite number of parameters by reference

From: Date: Mon, 08 May 2006 17:55:36 +0000
Subject: Re: Passing an indefinite number of parameters by reference
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-235738@lists.php.net to get a copy of this message
On Sun, May 7, 2006 1:20 pm, Chris Jenkinson wrote: > Currently I have a function which accepts a limited number of > parameters: > > call_function($function_name, &$var_1, &$var_2); > > I wish to modify the function to accept an indefinite number of > parameters, which may or may not be references. > > The function call_function() then calls the function specified in > $function_name, with the variables passed as parameters to that > function. > > Is this possible? Thanks for any help which can be offered. Possible?... Switch to PHP5 and make every parameter an object, so everything is a reference. I think you could MAYBE in PHP4 force everything to reference by sticking the & in the function calls. You'd probably end up using "eval" inside call_function in order to get the & in there... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#235738) next »