PHP 4.0 Bug #8514 Updated: function returning references changes other vars

From: Date: Tue, 06 Mar 2001 11:56:28 +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-48021@lists.php.net to get a copy of this message
ID: 8514 Updated by: stas Reported By: hp@oeri.ch Old-Status: Feedback Status: Closed Bug Type: Scripting Engine problem Assigned To: Comments: No feedback, closing. Previous Comments: --------------------------------------------------------------------------- [2001-01-09 10:25:24] stas@php.net Could you please provide example of the faulty code? --------------------------------------------------------------------------- [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!) --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=8514&edit=2

« previous php.dev (#48021) next »