|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-01 23:20 UTC] felipensp at gmail dot com
[2007-11-12 10:00 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 08:00:01 2025 UTC |
Description: ------------ See the result of code. Reproduce code: --------------- <?php $a = range(1,10); foreach ($a as &$b) { // normal # $a[0] = $a; // keys: 1,2,3 - seg. fault # $a[1] = $a; // odd result $a[4] = $a; //5... - seg. fault } var_dump($a); Actual result: -------------- Keys: - Normal: 0 - Seg. fault: 1,2,3,5... (this isn't a bug, right?) - Odd: 4 array(10) { [0]=> int(139421480) [1]=> int(2) [2]=> int(139421820) [3]=> int(139421252) [4]=> &array(10) { [0]=> int(139421480) [1]=> int(2) [2]=> int(139421820) [3]=> int(139421252) [4]=> &array(10) { [0]=> int(139421480) [1]=> int(2) [2]=> int(139421820) [3]=> int(139421252) [4]=> *RECURSION* [5]=> &int(139421480) [6]=> int(139421752) [7]=> int(139421616) [8]=> NULL [9]=> &int(139421480) } [5]=> &int(139421480) [6]=> int(139421752) [7]=> int(139421616) [8]=> NULL [9]=> &int(139421480) } [5]=> &int(139421480) [6]=> int(139421752) [7]=> int(139421616) [8]=> NULL [9]=> &int(139421480) }