In case I have this code
<?php
$array = array();
for ($i=1;$i<100000;$i++){
$array[$i] = md5(rand(0,9999999999999999));
}
$array2 = $array;
$array
takes about 0.5MB RAM, let's say. Does PHP proccess take about 1.0MB RAM with $array2 = $array;
? and in this case
<?php
class rand{
public $array;
function rand(){
$this->array = array();
for ($i=1;$i<100000;$i++){
$this->array[$i] = md5(rand(0,9999999999999999));
}
}
}
$class = new rand();
$class2 = $class;
$class
takes about 0.5MB RAM, let's say
. Does PHP proccess take 1.0MB with $class2 = $class
?
is it same?
Tests: