Re: Pointers For Newbies, Reminders For Oldies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux