Mapping values to references fails on php7

This commit is contained in:
Bartek Fabiszewski 2017-05-22 23:00:09 +02:00
parent f04b229644
commit 798d498001

View File

@ -265,11 +265,11 @@
*/
private function loadWithQuery($query, $bindParams = NULL) {
$stmt = self::$db->prepare($query);
if (is_array($bindParams) && ($types = array_shift($bindParams))) {
call_user_func_array(
[ $stmt, 'bind_param' ],
array_merge([ $types ], array_map(function(&$param) { return $param; }, $bindParams))
);
if (is_array($bindParams)) {
foreach ($bindParams as $key => &$value) {
$bindParams[$key] = $value;
}
call_user_func_array([ $stmt, 'bind_param' ], $bindParams);
}
if ($stmt->execute()) {
$stmt->bind_result($this->id, $this->timestamp, $this->userId, $this->trackId,