#45400 [NEW]: $foo = $foo does not work in some cases

From: Date: Tue, 01 Jul 2008 11:34:58 +0000
Subject: #45400 [NEW]: $foo = $foo does not work in some cases
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-126145@lists.php.net to get a copy of this message
From: php at darkk dot net dot ru Operating system: Linux, FreeBSD PHP version: 5.2.6 PHP Bug Type: Scripting Engine problem Bug description: $foo = $foo does not work in some cases Description: ------------ Converting from string to array using $name['foobar'] = $name does not work in some cases. Reproduce code: --------------- first: function foobar($name) { $name['anything'] = $name; var_dump($name); } foobar("foobar");' second: $name = "foobar"; $name['anything'] = $name; var_dump($name); Expected result: ---------------- in both cases I expect to see: array(1) { ["anything"]=> string(6) "foobar" } Actual result: -------------- first: string(6) "oobar" second: string(6) "foobar" -- Edit bug report at http://bugs.php.net/?id=45400&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45400&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45400&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45400&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45400&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45400&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45400&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45400&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45400&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45400&r=support Expected behavior: http://bugs.php.net/fix.php?id=45400&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45400&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45400&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45400&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45400&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45400&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45400&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45400&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45400&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45400&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45400&r=mysqlcfg

« previous php.bugs (#126145) next »