title: is call_user_func_array too slow?
body: <p>I  am writing a simple search engine for my database using mysqli and prepared statements, I'm currently using call_user_func_array to dynamically create  my query. My question is: is there a faster or better way to do this using mysqli?
  here's my code:</p>
  
  <pre><code>&lt;?php 
  session_start();
  require('../../../scripts/bkfunctions.php');
  header('Cache-Control: no-cache, must-revalidate');
  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  header('Content-type: application/json');
  
  //////////////////
  $resultParameters = array();
  $paramsArr =array();
  $results = array();
  
  
  
  
  ////DB OPEN//////////////////////////////////////////
  $conn = dbConnect("ITbunker");
  $paramsArr = explode(",", $_GET['paramsQuery']);
  $qStr="";
  $bindParams = array('s');
  
      ////////////////////////////////////
      foreach ($paramsArr as $n=&gt;$k) {
  
              if ($n==0) {
              $qStr = "SELECT * FROM trabajosEnSubasta WHERE MATCH(titulo, descripcion, habilidades) AGAINST (?)";
              }
              else {
              $qStr .= " UNION SELECT * FROM trabajosEnSubasta WHERE MATCH(titulo, descripcion, habilidades) AGAINST (?)";
              $bindParams[0] .= 's';
              }
              array_push($bindParams, $k);
      }
      ///////////////////////////////////////
  
      ///Preparar query y ejecutar
      $stmt = $conn-&gt;prepare($qStr);
      call_user_func_array(array($stmt, 'bind_param'), makeValuesReferenced($bindParams));
      $stmt-&gt;execute();
  
  /////////////////////////////////////////////////////////////////////////////////////////*
  
  $meta = $stmt-&gt;result_metadata();  
  
      while ($campo = $meta-&gt;fetch_field() ) {
      $resultParameters[] = &amp;$row[$campo-&gt;name];
      }
      call_user_func_array(array($stmt, 'bind_result'), $resultParameters);
  
      $i=0;
      while ( $stmt-&gt;fetch() ) {  
          $i++;
          foreach( $row as $key =&gt; $val ) {
          $results["resultado$i"][$key] = $val;
          }  
      }
  
  
  echo json_encode($results);
  ///////////////////////////////////////////////////
  
  $conn-&gt;close();
  ?&gt;
  </code></pre>