#34405 [Opn->Bgs]: return by reference using "new MyObject()"
| From: | sniper@php.net | Date: | Wed, 07 Sep 2005 10:46:59 +0000 |
| Subject: | #34405 [Opn->Bgs]: return by reference using "new MyObject()" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84616@lists.php.net to get a copy of this message | ||
ID: 34405
Updated by: sniper@php.net
Reported By: nicolas dot bui at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows XP SP22
PHP Version: 4.4.0
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2005-09-07 12:45:23] nicolas dot bui at gmail dot com
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 this bug report at http://bugs.php.net/?id=34405&edit=1