Bug #12172 Updated: Failure to bind a variable to an object's method that returns a reference

From: Date: Fri, 14 Dec 2001 19:49:56 +0000
Subject: Bug #12172 Updated: Failure to bind a variable to an object's method that returns a reference
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-73824@lists.php.net to get a copy of this message
ID: 12172 Updated by: yohgaki Reported By: mubarmej@muvix.com Old Status: Open Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows 2000 PHP Version: 4.0.6 New Comment: This is not a bug.... Referece to a function cannot be a LVALUE. Previous Comments: ------------------------------------------------------------------------ [2001-07-14 21:45:30] mubarmej@muvix.com The following line will give a compilation error: $arr = array( $stuff, &$this->refAll() ); refAll() is a method of the class that returnes a reference. This work around works: $ref = &$this->refAll(); $this->stack[] = array( $stuff, &$ref ); But i think that the one line solution should work too. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12172&edit=1

« previous php.dev (#73824) next »