As I understand it, when I passed an array by value, a copy of the array is created. that is, in the below software $ y and $ z, the same memory is required as for $ x. however, memory usage is practically not increasing. Obviously, my understanding is wrong, can someone explain the reason.
for($i=0;$i<1000000;$i++)
$x[] = $i;
echo memory_get_usage();
function abc($y){
$y[1] = 1;
$z[]= $y;
}
source
share