|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-07-01 23:47 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 24 20:00:01 2025 UTC |
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.