title: Only variables can be passed by reference - php
body: <p>i am trying this code, but i get this error:</p>
  
  <pre><code>Only variables can be passed by reference in xxx
  </code></pre>
  
  <p>script</p>
  
  <pre><code>class page {
    function insert($db, $of, $form, &amp;$arr) {
  
        $i = 0;
  
        foreach(array_combine($form['value0'], $arr) as $val=&gt;$v){
  
            $sql-&gt;prepare("mysqli query here");
            $sql-&gt;bind_param('ssss', $val, $of, $v[$i][0], $v[$i][1]);//error here
            $sql-&gt;execute();
            $i++;
  
        }
        return true;
    }
  }
  </code></pre>
  
  <p>what is the reason, and how can be solved ? thanks</p>