From: nicolas dot bui at gmail dot com
Operating system: Windows XP SP22
PHP version: 4.4.0
PHP Bug Type: Class/Object related
Bug description: return by reference using "new MyObject()"
Description:
------------
Since recent version of PHP 4.3.x (event 4.4), I receive this warning :
"Only variable references should be returned by reference".
I get this when my function/method return reference of a object create
directly by something like "return new MyObject()";
Reproduce code:
---------------
class MyObject {
}
class MyFactory {
function & create() {
return new MyObject();
}
}
Expected result:
----------------
simple i would like to avoid tons of warning messages.
--
Edit bug report at http://bugs.php.net/?id=34405&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34405&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34405&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34405&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34405&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34405&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34405&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34405&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34405&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34405&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34405&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34405&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34405&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34405&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34405&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34405&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34405&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34405&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34405&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34405&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34405&r=mysqlcfg