ID: 29441 Updated by: [EMAIL PROTECTED] Reported By: php at cyruslesser dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux Debian PHP Version: 5.0.0 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2004-07-29 08:44:27] php at cyruslesser dot com Description: ------------ This may just be my mis-understanding of how the language should work, but surely when you copy an object (class) and make changes to it, those changes shouldn't affect the original object? I don't really see the point in making a copy of an object, if the changes you make to the new copy affect the old copy. If I'm just dumb, then I apologise. Reproduce code: --------------- <? class c { var $i = 0; }; $a = new c; $a->i = 1; $b = $a; $b->i = 2; echo "a: $a->i"; echo "b: $b->i"; ?> Expected result: ---------------- a: 1 b: 2 Actual result: -------------- a: 2 b: 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29441&edit=1