#33542 [Opn->Fbk]: If referencing a function that returns a variable, error occurs
| From: | derick@php.net | Date: | Sat, 02 Jul 2005 10:12:15 +0000 |
| Subject: | #33542 [Opn->Fbk]: If referencing a function that returns a variable, error occurs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81292@lists.php.net to get a copy of this message | ||
ID: 33542
Updated by: derick@php.net
Reported By: rick dot martinez at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: All
PHP Version: 5CVS-2005-07-01 (dev)
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2005-07-01 23:47:05] rick dot martinez at gmail dot com
Description:
------------
I have a static function that is supposed to return an instance of an
object.
$object = &Object2::getObject();
This works perfectly in PHP 5.0.4.4 but breaks in PHP5.0.x CVS. It
returns error:
* Only variables should be assigned by reference
If I create an instance for that variable first, it gets fixed.
$object = new object;
$object = &Object2::getObject();
Is this proper behavior or is this some sort of bug? If it is proper
behavior, please change this back. It breaks a LOT of my code. Thanks.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33542&edit=1