Archives

Assigning the return value of new by reference is deprecated

Error Comments Off on Assigning the return value of new by reference is deprecated

Error Description: Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\joomla\libraries\pattemplate\patTemplate.php on line 1424

You will get such error in joomla in window server if you using wamp or xamp.

Why Error Comes: PHP 4 introduced basic OOP to PHP, however it had a few key issues which were fixed in PHP 5.3.

Bear in mind that OOP is a concept which has feature which should be consistent between the many different programming languages which implement it.

In most programming languages, an object can be passed to functions or other objects by reference, not by value. In other words, rather than passing a new object with the same values, the actual object is passed, meaning changes are kept.Because of this, you had to manually pass the object by reference rather than by value:

Solution: You need to use php’s older version 5.2 or need to remove call by reference.
1)– You can install this add-on for wamp download wamp with php 5.2 from here

– After installing the addon, you need to select the php version from wamp-icon on right side of taskbar, just click on icon, go to php and then version, and then choose the new lower version, to make it work

2) : Just left click WAMP icon in systray, select PHP -> PHP settings  uncheck “display errors”. This is also remove error but not prefect solution

3) Rremove the & and it’ll work as before

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\natega2010\prep1\term1\phpfn50.php on line 1139 is solved

So either you need call by reference or