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.3.0
4478.0390625kB 4478.328125kB
Output for 7.2.0 - 7.2.13
4474.1875kB 4474.4765625kB
Output for 7.0.0 - 7.1.25
4438.4375kB 4438.7265625kB
Output for 5.6.0 - 5.6.38
14520.0078125kB 14520.3203125kB
Output for 5.5.0 - 5.5.38
14520.0078125kB 14520.3125kB
Output for 5.4.10 - 5.4.45
14520.4765625kB 14520.78125kB
Output for 5.4.0 - 5.4.9
14519.921875kB 14520.1875kB
Output for 5.3.17 - 5.3.29
14913.796875kB 14914.0546875kB