PHP Classes

Assigning the return value of new by reference is deprecated

Recommend this page to a friend!

      PHPXBase  >  All threads  >  Assigning the return value of new by...  >  (Un) Subscribe thread alerts  
Subject:Assigning the return value of new by...
Summary:New warnings in PHP5
Messages:4
Author:Kampman
Date:2012-04-20 19:37:24
Update:2013-03-19 13:53:35
 

  1. Assigning the return value of new by...   Reply   Report abuse  
Picture of Kampman Kampman - 2012-04-20 19:37:24
If I use it, I get these warnings:
Deprecated: Assigning the return value of new by reference is deprecated in Table.class.php on line 108
Table.class.php on line 149
Table.class.php on line 162

And since I am not allowed to change the code ;-)
How can I solve this?

By the way: great job!

  2. Re: Assigning the return value of new by...   Reply   Report abuse  
Picture of prokee prokee - 2013-03-19 13:53:35 - In reply to message 1 from Kampman
Just replace =& to simple = in that rows. By another words: remove the ampersands from 108, 149 and 162 rows.

"& is used in PHP to pass an object to a method / assign a new object to a variable by reference. It is depricated in PHP 5 because PHP 5 passes all variables by reference by default."

  3. Re: Assigning the return value of new by...   Reply   Report abuse  
Picture of Totof Totof - 2014-12-05 12:07:04 - In reply to message 2 from prokee
If replace =& by = the test.php page don't return any content field...

  4. Re: Assigning the return value of new by...   Reply   Report abuse  
Picture of Arpad Toth Arpad Toth - 2015-11-14 00:08:31 - In reply to message 3 from Totof
Change all =& to = in every class php and in the api_conversion.php, that will fix the problem.