Scrappy coding! Assigning the return value of new by reference is deprecated

Written by Peter Davies on .

We run a number of Joomla, Wordpress and Magento sites and with 3rd party extensions this crops up now and again:

Assigning the return value of new by reference is deprecated

PHP 5 has numerous improvements plus the obvious highlighted by the error which is that the following snippet:

$gallery =& new YOOGallery($params);
echo $gallery->render();

Just needs to be fixed by removing the PHP reference "&":

$gallery = new YOOGallery($params);
echo $gallery->render();