php - Call-time pass-by-reference has been deprecated, array_push error -
i'm using mysqlidb class , gives error:
"deprecated: call-time pass-by-reference has been deprecated in c:...\mysqldb.php on line 101", 340, 348 , 375
where array_push function:
array_push($params, &$bindparams[$prop]); array_push($this->_bindparams, &$tabledata[$prop]); i removed "&" , worked these /\ two, not these / 2 (giving lot of errors)
if($hasconditional) { if ($this->_where) { $this->_bindparams[0] .= $this->_wheretypelist; foreach ($this->_where $prop => $val) { array_push($this->_bindparams, &$this->_where[$prop]); } } } and
while ($field = $meta->fetch_field()) { array_push($parameters, &$row[$field->name]); } the mysqlidb class can found here: https://github.com/ajillion/php-mysqli-database-class
array_push equivalent appending element array. can rewrite line
array_push($this->_bindparams, &$this->_where[$prop]); to
$this->_bindparams[] = & $this->_where[$prop]; in case.
the e_deprecated error warning btw. passing reference still possible. avoid warning, alternatively force clumsy workaround:
call_user_func_array("array_push", array(&$this->_bindparams, &$this->_where[$prop])); (it needs pass reference both params then.)
Comments
Post a Comment