|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-02-02 14:51 UTC] andrei at cvs dot php dot net
[2000-02-02 14:57 UTC] zeev at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 05:00:01 2025 UTC |
Revert_Array_Layout_2 will use fast memmory without freeing it when done (result hanging machine, out of memmory) Revert_Array_Layout_3 is the same as *_2 and will not use the memmory i guess you can figure out where's the bug (list or each i think) P.S Make the array bigger and you will crash faster :) <? function Revert_Array_Layout_2 ($wico) { while (list($key, $value) = each($wico)) { $revert[$value] = $key; } return($revert); } function Revert_Array_Layout_3 ($wico) { $total = count($wico); for ($x = 0; $x < $total; $x++) { $revert[$wico[$x]] = $x; } return($revert); } function Get_Unique_Array_Values_2($wico) { return(Revert_Array_Layout_2(Revert_Array_Layout_2($wico))); } for ($y = 0; $y < 100000; $y++) { unset($wico); for ($x = 0; $x < 20; $x++) { $wico[$x] = "$x"; $wico[$x + 1] = "$x"; $x++; } $temp = Get_Unique_Array_Values_2($wico); } ?>