The following code causes a 'deprecated' error in PHP 5.3... Is there a substitute for it?
$this->widgets[$widget_class] = & new $widget_class();
The following code causes a 'deprecated' error in PHP 5.3... Is there a substitute for it?
$this->widgets[$widget_class] = & new $widget_class();
It'd be nice if you could specify what exactly the error message says, but I'm guessing it's informing you that object assignment by reference (=&
) is deprecated. Objects are always assigned and passed by reference as of PHP 5, so including &
is unnecessary. Simply drop the reference operator:
$this->widgets[$widget_class] = new $widget_class();