Deprecated Warning : Assigning the return value of new by reference is deprecated in * on line *

By | November 7, 2013

Hey there,

Did you get this Warning/Notice? :

Deprecated Warning : Assigning the return value of new by reference is deprecated in *  on line *

In PHP5 this notation is deprecated

$obj =& new Class();

That would generate the warning but ‘&’ is not required and can be removed.

$obj = new Class();

To see why this was used in PHP4, see  http://www.php.net/manual/en/oop4.newref.php

Cheers,

JENSon.




Leave a Reply

Your email address will not be published. Required fields are marked *