News for hackers. Stuff that matters.
Re:PHP Bug #63281 by bartl on Thursday November 01, 2012 @05:46AM (#4726810)
The problem is that `bindparam` binds by reference, and `foreach` reuses the same variable for `$value`, with the same reference, in the loop?

Then the solution could be to use `&$value` instead. Untested:

    foreach( $bind_params as $key => &$value ){
      $statement->bindParam($key, $value);
    }
    unset($value);
BTW The fact that you need to manually break the connection between the loop variable and the array item value using `unset` is a bug, in my opinion.

There are no comments on this comment yet.