The following code causes a ‘deprecated’ error in PHP 5.3… Is there a substitute for it?
$this->widgets[$widget_class] = & new $widget_class();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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: