title: php5.3 - mysqli_stmt:bind_params with call_user_func_array warnings
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/295016/is-it-possible-to-pass-parameters-by-reference-using-call-user-func-array">Is it possible to pass parameters by reference using call_user_func_array()?</a>  </p>
  </blockquote>
  
  
  
  <p>I have the following line of code which worked in PHP 5.1, but isn't working in PHP 5.3.</p>
  
  <pre><code>$input = array('ss','john','programmer');
  call_user_func_array(array($mysqli_stmt, 'bind_param'), $input);
  </code></pre>
  
  <p>In PHP 5.3, I get the following warning message:</p>
  
  <blockquote>
    <p>Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in /var/www/startmission/em/class/cls.data_access_object.php on line 785 </p>
  </blockquote>
  
  <p>I changed the code to the following and it worked:</p>
  
  <pre><code>$a = 'johnl';
  $b = 'programmer';
  $mysqli_stmt-&gt;bind_param('ss',$a,$b);
  </code></pre>
  
  <p>I found this in the php documentation:</p>
  
  <blockquote>
    <p>Care must be taken when using mysqli_stmt_bind_param() in
    conjunction with call_user_func_array(). Note that
    mysqli_stmt_bind_param()  requires parameters to be passed by reference,
    whereas call_user_func_array() can accept as a parameter a list of
    variables that can represent references or values.</p>
  </blockquote>
  
  <p>So my question is, how do I replicate the functionality of the call_user_func_array + bind_params such that i can dynamically bind variables at run time?</p>