Delegating variable-length argument lists

From: Date: Fri, 02 Jul 2010 15:25:47 +0000
Subject: Delegating variable-length argument lists
Groups: php.general 
Request: Send a blank email to php-general+get-306638@lists.php.net to get a copy of this message
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

« previous php.general (#306638) next »