- Output for 7.1.10
- 8998480 bytes
14030000 bytes
Process exited with code 137. - Output for 7.1.0 - 7.1.7
- 8998480 bytes 14030000 bytes
- Output for 7.0.0 - 7.0.20
- 8998424 bytes 14030000 bytes
<?php
$array = [];
$startMemory = memory_get_usage();
foreach (range(1, 100000) as $i) {
$array[] = "adfsdfghsfghfsgh $i";
}
echo memory_get_usage() - $startMemory, " bytes\n";
$startMemory = memory_get_usage();
foreach (range(1, 100000) as $i) {
$array["test$i"] = "sdfghsfghsfg $i";
}
echo memory_get_usage() - $startMemory, " bytes\n";