pass by reference variable length args

From: Date: Wed, 06 Jan 2010 03:48:42 +0000
Subject: pass by reference variable length args
Groups: php.general 
Request: Send a blank email to php-general+get-300842@lists.php.net to get a copy of this message
hi all, i'm trying to write a wrapper function for "mysqli_stmt_bind_results". and expect it to work the same way it accepts and bind results to the original function. the problem is, i couldn't find a way to pass the args by reference via func_get_args and register the out put from call_user_func_array to the caller scope.. any idea? here goes few lines which i'm trying hard for past 48 hours.. with no luck.. :( class stmt { private $stmt; public function bind_result() { $argsToBindResult = func_get_args(); $argList = array($this->stmt); $argList = array_merge($argList, $argsToBindResult); call_user_func_array('mysqli_stmt_bind_result', $argList); } } $stmt->prepare('SELECT name,email FROM users WHERE id = ?'); $stmt->bind_param('i',2); .. .. $stmt->bind_result($name,$email); echo $name,$email;

« previous php.general (#300842) next »