#34137 [NEW]: assigning array element by reference causes binary mess

From: Date: Mon, 15 Aug 2005 15:28:36 +0000
Subject: #34137 [NEW]: assigning array element by reference causes binary mess
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83598@lists.php.net to get a copy of this message
From: rashid at ds dot pg dot gda dot pl Operating system: windows xp PHP version: 5CVS-2005-08-15 (snap) PHP Bug Type: Arrays related Bug description: assigning array element by reference causes binary mess Description: ------------ If you have an array which contains another array and you`ll assign reference to the inner array to the variable containing the outer array youll see all kinds of binary trash. With bigger arrays Ive also seen Apache crashes. I`ve used lates available 5.0.x snapshot: Fri, 12 Aug 2005 19:09:17 +0200 Version: 5.0.5-dev Branch: HEAD Build: Release_TS and lastes 5.1.x snapshot Fri, 12 Aug 2005 23:13:30 +0000 Version: 5.1.0-dev Branch: HEAD Build: Release_TS Reproduce code: --------------- <?php $arr1 = array('a1' => array('alfa' => 'beta')); $arr1 =& $arr1['a1']; echo '-'.$arr1['alfa'].'-'; ?> Expected result: ---------------- -beta- Actual result: -------------- --eta- -- Edit bug report at http://bugs.php.net/?id=34137&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34137&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34137&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34137&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34137&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34137&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34137&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34137&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34137&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34137&r=support Expected behavior: http://bugs.php.net/fix.php?id=34137&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34137&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34137&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34137&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34137&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34137&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34137&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34137&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34137&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34137&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34137&r=mysqlcfg

« previous php.bugs (#83598) next »