0
votes

I have PHP 5.3.8 and the error I get is on this line:

array_unshift($this->parents, &$this->parent);

The value of $this->parent comes from:

$this->parent[$key] = array();
$this->parent = &$this->parent[$key];

The error message is:

Deprecated: Call-time pass-by-reference has been deprecated in /var/www/vhosts/mauilistings.net/httpdocs/xml/kd_xmlrpc.php on line 136

Taking off the & sign does not help, the function no longer works.

1
whats the value of $this->parent ? - djjjuk
just remove & it will work - Praveen kalal
Well array_unshift should still work, however you might need to change some other function as well. - hakre
why are you prefixing $this->parent[$key] with & ? - djjjuk
$this->parent[$key] is an array - Lawrence DeSouza

1 Answers

2
votes

From PHP docs:

As of PHP 5.3.0, you will get a warning saying that "call-time pass-by-reference" is deprecated when you use & in foo(&$a);. And as of PHP 5.4.0, call-time pass-by-reference was removed, so using it will raise a fatal error.