Should anyone be planning experiments or projects with large arrays, use a for() loop instead of a foreach() loop when working with your array. And be sure to count the array, stick that result into a variable, then compare against the variable instead of running the count() again.

On huge arrays (hundreds of thousands of elements, three dimensions, several megabytes) the performance impact is huge! The downside is you'll probably have to use numeric keys instead of associative, but for big arrays, numeric keys will probably also keep more memory free and improve performance a bit.

Good luck with your arrays!

-Galen

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



Reply via email to