From: remon at menpmedia dot nl Operating system: Fedora Core 4 PHP version: 5.2.6 PHP Bug Type: Class/Object related Bug description: Assignment is done as if by reference
Description: ------------ Problem: Changing property of a copy of an object results in the changing of the original object as if by reference. Correct output is from 5.2.4 Incorrect output is from 5.2.6 This problem does NOT occur when using an array! configure command (taken from phpinfo()) './configure' '--with-apxs' '--with-curl=/usr/local/lib' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-mbstring' other info; sorry, unavailable; we do not have root access to the server in question. Cannot get a diff between the ini and ini-dist, cannot do a trace. Reproduce code: --------------- <?php $one = new stdClass(); $one->variable = "hello"; $two = $one; $two->variable = "goodbye"; var_dump($one); ?> Expected result: ---------------- object(stdClass)#3 (1) { ["variable"]=> string(5) "hello" } Actual result: -------------- object(stdClass)#1 (1) { ["variable"]=> string(7) "goodbye" } -- Edit bug report at http://bugs.php.net/?id=44933&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44933&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44933&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44933&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44933&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44933&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44933&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44933&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44933&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44933&r=support Expected behavior: http://bugs.php.net/fix.php?id=44933&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44933&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44933&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44933&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44933&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44933&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44933&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44933&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44933&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44933&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44933&r=mysqlcfg