title: Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object
body: <p>I had use call_user_func_array and on my localhost the script work perfect but when i upload on server it give me 2 error and i do not know why .. 
  can any body help me to get over it .It would be appreciated. thanks in advance </p>
  
  <p>Errors below.</p>
  
  <p><strong>Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object</strong></p>
  
  <p><strong>Fatal error: Uncaught Error: Call to a member function execute() on boolean</strong></p>
  
  <p>Small part of code is below which is related to these errors</p>
  
  <pre><code>&lt;?php 
        $location_title="";
        $num_of_rows="";
        if(isset($_POST['search_forsale'])){
          $query="SELECT * FROM sales WHERE id&gt;0";
          $params = array();
          if(!empty($_POST['location'])){
            $location=trim("%{$_POST['location']}%");
            $location_title=$_POST['location'];
            $query.=" AND lower(location) LIKE ?";
            $params[]=$location;
          }
          if(!empty($_POST['min_price'])){
            $min_price=$_POST['min_price'];
            $query.=" AND price&gt;=?";
            $params[]=$min_price;
          }
          if(!empty($_POST['max_price'])){
            $max_price=$_POST['max_price'];
            $query.=" AND price&lt;=?";
            $params[]=$max_price;
          }
          if(!empty($_POST['category'])){
            $category=$_POST['category'];
            $query.=" AND category=?";
            $params[]=$category;
          }
          if(!empty($_POST['bedrooms'])){
            $bedrooms=$_POST['bedrooms'];
            $query.=" AND bedrooms=?";
            $params[]=$bedrooms;
          }
          if(!empty($_POST['sort_by'])){
            $sort_by=$_POST['sort_by'];
            $query.=" ORDER BY ?";
            $params[]=$sort_by;
          }
          if(!empty($_POST['title'])){
            $title=trim("%{$_POST['title']}%");
            $query.=" AND lower(title) LIKE ?";
            $params[]=$title;
          }
  
          $param_types = '';                        
          foreach($params as $param){        
            if(is_int($param)){
              $param_types .= 'i';          
            }elseif(is_float($param)){
              $param_types .= 'd';           
            }elseif(is_string($param)){
              $param_types .= 's';        
            }else{
              $param_types .= 'b';     
            }
          }
          array_unshift($params, $param_types);
          $connect=Connect_db();
          $stmt = $connect-&gt;stmt_init();
  
          function refValues($arr){
            if(strnatcmp(phpversion(),'5.3')&gt;=0){
                $refs = array();
                foreach($arr as $key =&gt; $value)
                  $refs[$key] = &amp;$arr[$key];
                return $refs;
            }
            return $arr;
          }
          **$stmt=$connect-&gt;prepare($query);
          call_user_func_array(array($stmt,'bind_param'),refValues($params));
          $execute_query=$stmt-&gt;execute();
          $result=$stmt-&gt;get_result();
          $num_of_rows=$result-&gt;num_rows;**
  </code></pre>
  
  <p>Bold part is main code where the error line showed</p>