Delegating variable-length argument lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

i'm writing a custom wrapper for the mysqli_stmt class. I have to
override the method mysqli_stmt::bind_param. This function uses
"variable-length argument lists". In my function i want to delegate its
arguments to the original function.

My first naiv implementation was that:

function bind_param($types) {
	$sParams=array();
        $first=true;
        for($i=1; i < func_num_args(); $i++) {
            $sParams[] = func_get_arg($i);
        }
	
	array_unshift ($sParams ,$types);
        call_user_func_array (array ($this->mysqli_stmt, 'bind_param'),	
		$sParams);
}

But this is not working, because  I need to pass it by reference. Is
there a way to retrieve references to a variable number of arguments?

Thx, Jakob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux