3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = range(0, 1e5); echo memory_get_peak_usage()/1024 . 'kB' . PHP_EOL; foreach ($array as $i => $a) { (bool)$a; } echo memory_get_peak_usage()/1024 . 'kB';
based on YeJKR
Output for 7.2.0
4474.2265625kB 4474.515625kB
Output for 7.0.0 - 7.1.0, 7.1.7 - 7.1.10
4438.5078125kB 4438.796875kB
Output for 7.1.5 - 7.1.6
4438.6640625kB 4438.953125kB
Output for 5.6.8 - 5.6.28
14520.2109375kB 14520.5234375kB
Output for 5.5.24 - 5.5.35
14520.2109375kB 14520.515625kB
Output for 5.4.10 - 5.4.45
14520.625kB 14520.890625kB
Output for 5.4.2 - 5.4.9
14520.109375kB 14520.375kB
Output for 5.3.17 - 5.3.29
14913.796875kB 14914.0546875kB