I'd like to add that when dealing with large memory structures,
usually arrays, combining them is fastest when done like this:

$array1 += $array2;

This will not always produce correct results when dealing with arrays
that contain identical keys, but for non-overlapping arrays it is far
faster than array_merge()

And if your script needs to pass large (> 5Mb) arrays around to
functions, be sure to use passing-by-reference; failing to do so can
double your memory requirements,
possibly hitting the ini_set('memory_lmit', ??)

$arr = array ( /* much data */ );

function workerFunc (&$data) {
  //work on $data, as you would normally.
}

workerFunc (&$arr);

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to