ID: 15025 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Critical +Status: Won\'t fix Bug Type: Scripting Engine problem Operating System: FreeBSD, Linux PHP Version: 4.3.0-dev
Previous Comments: ------------------------------------------------------------------------ [2002-10-01 05:47:08] [EMAIL PROTECTED] This has to do with the fact we don't deep-search when we copy values. $a is not a reference, but has an element inside it which is a reference. Therefore, when $a is copied to $c, and no deep search is made, $c ends up having that reference inside of it as well. It may be possible to fix, but right now I'm just wanted to add the analysis here... ------------------------------------------------------------------------ [2002-09-17 20:50:58] [EMAIL PROTECTED] updating version. ------------------------------------------------------------------------ [2002-09-17 13:31:26] [EMAIL PROTECTED] Verified with 4.2.3 on Windows 2000 too. ------------------------------------------------------------------------ [2002-01-13 22:32:27] [EMAIL PROTECTED] $c should not have been affected by the assignment to $b because $c should only be a copy to $a. What happened is the first echo shows 5 and after assignment to $b, the content of $c changes to 1 when it should stay as 5. ------------------------------------------------------------------------ [2002-01-13 22:18:55] [EMAIL PROTECTED] You can guess / see from this simple script: $a = array(5); $b =& $a[0]; $c = $a; echo $c[0]; $b = 1; echo $c[0]; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15025&edit=1