Edit report at http://bugs.php.net/bug.php?id=52617&edit=1
ID: 52617 User updated by: s dot cimini at email dot it Reported by: s dot cimini at email dot it Summary: call_user_func_array don't properly get parameters to a method Status: Bogus Type: Bug Package: Unknown/Other Function Operating System: Ubuntu Server 10.04 32 bit PHP Version: 5.3.3 Block user comment: N New Comment: I've tried the code on Ubuntu Desktop 10.04 32bit, 10.04 64bit and Server 32bit, all this versions are using PHP 5.3.2. There is effectively an error, i haven't set the Display_error = On, now it's set to On. This is the error: Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in /var/www/test.php on line 11 I've tried also: $val=array_merge(array($types),$values); call_user_func_array(array($stmt, "bind_param"), $val); and $val=array_merge(array($types),$values); call_user_func_array(array($stmt, "bind_param"), &$val); But the error is the same. Previous Comments: ------------------------------------------------------------------------ [2010-08-17 17:27:50] johan...@php.net The behavior of PHP 5.2 was wrong and got fixed. bind_param expects references, so you have to pass an array of referenced variables to the method. If you have full error reporting you should receive an error message about this. ------------------------------------------------------------------------ [2010-08-17 03:32:27] fel...@php.net I cannot reproduce any problem using the follow sample code: var_dump(call_user_func_array(array(new simplexmlelement('<a><b/></a>'), 'xpath'), array('//a'))); ------------------------------------------------------------------------ [2010-08-16 11:24:18] s dot cimini at email dot it Description: ------------ The PHP version is 5.3.2 and not 5.3.3, but 5.3.2 is not present in the combo. When i try do execute a script that with PHP 5.2.9 on a Windows pc works in a Ubuntu server 10.04 with PHP 5.3.2 don't work. It appears that the second part of the function, the part relative to the parameters, don't get the parameters to the method of the first part. Test script: --------------- $db_user="root"; $db_password="password"; $db_host="localhost"; $mysqli = new mysqli($db_host, $db_user, $db_password, "database"); $query = "select id from table where name like ?"; $types="s"; $values[]="a%"; $stmt = $mysqli->prepare($query); call_user_func_array(array($stmt, "bind_param"), array_merge(array($types),$values)); $stmt->execute(); $stmt->bind_result($id); while($stmt->fetch()){ echo($id."<br />"); } $mysqli->close(); Expected result: ---------------- A list of ids. Actual result: -------------- Nothing and the excution don't give any errors ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52617&edit=1