#34137 [Opn->Bgs]: assigning array element by reference causes binary mess

From: Date: Mon, 15 Aug 2005 16:28:24 +0000
Subject: #34137 [Opn->Bgs]: assigning array element by reference causes binary mess
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83602@lists.php.net to get a copy of this message
ID: 34137 Updated by: sniper@php.net Reported By: rashid at ds dot pg dot gda dot pl -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: windows xp PHP Version: 5CVS-2005-08-15 (snap) New Comment: Where does it say that you are allowed to do that? (hint: Try var_dump() on it..) Previous Comments: ------------------------------------------------------------------------ [2005-08-15 17:28:35] rashid at ds dot pg dot gda dot pl 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 this bug report at http://bugs.php.net/?id=34137&edit=1

« previous php.bugs (#83602) next »