3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startMemory = memory_get_usage(); $array = range(1, 100000); echo memory_get_usage() - $startMemory, " bytes\n"; $startMemory = memory_get_usage(); foreach (range(1, 100000) as $i) { $array["test$i"] = $i; }; echo memory_get_usage() - $startMemory, " bytes\n";
based on GTXiW
Output for 7.0.0 - 7.1.7, 7.2.0 - 7.2.6
4198480 bytes 9230792 bytes
Output for 7.1.10
4198480 bytes 9230792 bytes
Process exited with code 137.
Output for hhvm-3.15.4
4194304 bytes 12582912 bytes
Output for 5.6.3 - 5.6.30
14649000 bytes 16240704 bytes
Output for 5.6.0 - 5.6.2
14649032 bytes 16240720 bytes