I’m converting some old PHP 4.x code for PHP 5.3. I’ve come across the following, and I’m not sure what it does.
$variable =& new ClassName();
What is the difference between that, and:
$variable = new ClassName();
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.
In Ye Olde Days of PHP4, =& was necessary when constructing objects. In PHP 5, it’s not.
=&does reference assignment.E.G.:
In other words, it has its uses, just not when instantiating an object. For that use, it’s been depreacted.