<?php
$array = ['foo'=>1];
$last = $current = memory_get_usage();
foreach($array as $k=>&$v)
{
$last = $current;
$current = memory_get_usage();
echo "Diff is " . ($current - $last) . "\n";
$array['baz']=3;
$last = $current;
$current = memory_get_usage();
echo "Diff is " . ($current - $last) . "\n";
echo $v . "\n";
}
- Output for 7.4.0 - 7.4.1
- Diff is 440
Diff is 32
1
Diff is 32
Diff is 0
3
- Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13
- Diff is 424
Diff is 32
1
Diff is 24
Diff is 0
3
- Output for 7.0.0 - 7.0.33
- Diff is 48
Diff is 32
1
Diff is 24
Diff is 0
3
- Output for 5.6.0 - 5.6.40
- Diff is 448
Diff is 184
1
- Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
- Diff is 480
Diff is 168
1
- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
- Parse error: syntax error, unexpected '[' in /in/iODrh on line 3
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected '[' in /in/iODrh on line 3
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/iODrh on line 3
Process exited with code 255.
preferences:
228.09 ms | 401 KiB | 325 Q