ID: 33591
Comment by: sl at yes-co dot nl
Reported By: nobody at somewhere dot de
Status: No Feedback
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.11
New Comment:
Output on PHP 5.1.0-dev (Jul 21 2005 08:29:50):
array(1) {
[0]=>
string(15) "[element of ar]"
}
array(1) {
[0]=>
string(15) "[element of ar]"
}
array(1) {
[0]=>
string(18) "[i DIDN'T set ar!]"
}
Previous Comments:
------------------------------------------------------------------------
[2005-07-14 01:00:04] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-07-06 16:57:11] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2005-07-06 16:48:50] nobody at somewhere dot de
Description:
------------
I don't know about any php-Interna
Somehow a PHP-Variable seems to have a Flag that means "Is a
Reference". This Flag is not resetted under the conditions I show in
the code below.
Cheers!
Reproduce code:
---------------
#---
global $ar;
$ar= array("[element of ar]");
var_dump($ar);
$ok= f();
$ok[0]= "[i DIDN'T set ar!]";
var_dump($ar);
$bug= & f();
$bug= f(); # bug! doesn't reset reference-flag
$bug[0]= "[i DIDN'T set ar!]";
var_dump($ar);
function & f() {
global $ar;
return $ar;
}
exit;
#---
Expected result:
----------------
array(1) { [0]=> string(15) "[element of ar]" }
array(1) { [0]=> string(15) "[element of ar]" }
array(1) { [0]=> string(15) "[element of ar]" }
Actual result:
--------------
array(1) { [0]=> string(15) "[element of ar]" }
array(1) { [0]=> string(15) "[element of ar]" }
array(1) { [0]=> string(18) "[i DIDN'T set ar!]" }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33591&edit=1