#33542 [NEW]: If referencing a function that returns a variable, error occurs

From: Date: Fri, 01 Jul 2005 21:47:05 +0000
Subject: #33542 [NEW]: If referencing a function that returns a variable, error occurs
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81279@lists.php.net to get a copy of this message
From: rick dot martinez at gmail dot com Operating system: All PHP version: 5CVS-2005-07-01 (dev) PHP Bug Type: Scripting Engine problem Bug description: If referencing a function that returns a variable, error occurs 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 bug report at http://bugs.php.net/?id=33542&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33542&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33542&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33542&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33542&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33542&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33542&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33542&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33542&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33542&r=support Expected behavior: http://bugs.php.net/fix.php?id=33542&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33542&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33542&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33542&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33542&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33542&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33542&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33542&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33542&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33542&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33542&r=mysqlcfg

« previous php.bugs (#81279) next »