PHP 4.0 Bug #8514 Updated: function returning references changes other vars
| From: | stas@php.net | Date: | Tue, 09 Jan 2001 15:25:24 +0000 |
| Subject: | PHP 4.0 Bug #8514 Updated: function returning references changes other vars | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-43567@lists.php.net to get a copy of this message | ||
ID: 8514
Updated by: stas
Reported By: hp@oeri.ch
Old-Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Assigned To:
Comments:
Could you please provide example of the faulty code?
Previous Comments:
---------------------------------------------------------------------------
[2001-01-02 06:28:42] hp@oeri.ch
According to doc, to return references I need the following:
function &IReturnRef() AND $myvar = &IReturnRef();
(ampersand in BOTH places!)
Upto 4.03pl1, it worked quite well w/o ampersand in the call... Now in 4.0.4 it works, too BUT
CHANGES OTHER VARS (vars totally unrelated to the function call!). I've yet to find out, when
and which vars it touches... It seems to be the vars defined just before the call or the var used
with the last call of the same function.
May I suggest that:
a) there's an error msg, if I call such a function w/o ampersand
(hey, we're all human and forget things now and then)
OR
b) the behaviour is changed such that an ampersand in EITHER place
returns a reference (this would be REALLY nice!)
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8514