ID: 33542
User updated by: rick dot martinez at gmail dot com
Reported By: rick dot martinez at gmail dot com
-Status: No Feedback
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: All
PHP Version: 5CVS-2005-07-01 (dev)
New Comment:
This bug was resolved by changing some code.
If you add a & before the name of the function in the function
declaration:
function &myFunction() { }
it allows it to be passed as a reference. Hope this helps.
Previous Comments:
------------------------------------------------------------------------
[2005-07-29 23:35:59] luciano_closs at hotmail dot com
And about the last post: I'm using PHP 4.4.1.
------------------------------------------------------------------------
[2005-07-29 22:06:11] luciano_closs at hotmail dot com
I have the same error. I suppose that I don't need to get a xml parser
by reference, I do not analyse all the code yet, since this code was
get from an Open Source Project.
I posted a sample code at:
http://www.infopoa-ti.com/xml_parser_by_ref.zip
------------------------------------------------------------------------
[2005-07-10 01:00:04] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-07-02 12:12:13] [EMAIL PROTECTED]
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.
------------------------------------------------------------------------
[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