|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-11-30 15:11 UTC] ryan at ongawari dot com
Description:
------------
array_unshift can only run 1965 times
Reproduce code:
---------------
for ($i=0;$i<$numrows;++$i) {
array_unshift($dataarray[$i],($i+1));
}
Expected result:
----------------
To prepend the 2d array with a column that represents the row number of
the 2D array
Actual result:
--------------
Apache crashes at line 1965 (when $i=1965)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
<?php function addrownumbers(&$dataarray) { $numrows = count($dataarray); for ($i = 0; $i < $numrows; ++$i) array_unshift($dataarray[$i],($i+1)); } $dataarray=array(); for($j=0;$j<8000;++$j) for($k=0;$k<8;++$k) $dataarray[$j][$k]=rand(0,10000); addrownumbers($dataarray); ?>