Forum Moderators: coopster

Message Too Old, No Replies

Would removing array duplication lower memory?

I don't really know how to benchmark/check this..?

         

rollinj

11:09 am on Jan 13, 2010 (gmt 0)

10+ Year Member



I have a large array of data being input to a php function.

The function must then altar that array, creating a new one, that is 3 times larger, to work with.

So:

$array1 = 10,000 values
$array2 = 30,000 values, derived from $array1

After $array2 is crafted, $array1 is useless.

Would it be beneficial for me to use the code:

$array1 = "";

...after $array2 has been created?

vincevincevince

2:36 pm on Jan 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



unset($array1);