I've just got an error.
When I try to assign an object like this:
$obj_md = new MDB2();
The error I get is "Assigning the return value of new by reference is deprecated". Actually I've been looking for a solution but the only one I've seen is just turn down the politicy of php.ini (error_reporting). I've tried it too, but it didn't work.
It's so confusing..I hope you could help me. Thanks in advance.
I had the same problem. I already had the '&' and still it was giving the same warning. I'm using PHP 5.3 with WAMP and all i did was REMOVE '&' sign and the warning was gone.
It happened because of PHP 5.3 , which comes in WAMP 2.0i package and not Joomla.
You have two choices to fix it,
either use WAMP 2h (previous version) or download PHP 5.2.9-2 addon from WAMP website.
just remove
new
in the$obj_md =& new MDB2();
Nitin is correct - the issue is actually in the MDB2 code.
According to Replacement for PEAR: MDB2 on PHP 5.3 you can update to the SVN version of MDB2 for a version which is PHP5.3 compatible.
As that answer was given in March 2010, and http://pear.php.net/package/MDB2/ shows a release some months later, I expect the current version of MDB2 will solve the issue also.
& is used in PHP to pass an object to a method / assign a new object to a variable by reference. It is deprecated in PHP 5 because PHP 5 passes all variables by reference by default.
Perhaps the constructor of MDB2 has some code that uses a $variable =& new ClassName();