3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array(); for($i = 0; $i < 8000; $i++) { $data[] = "あ"; } echo "point1:".memory_get_usage()."\n"; foreach ($data as $d) {} echo "point2:".memory_get_usage()."\n";
Output for 7.1.0
point1:613472 point2:613504
Output for 7.0.0 - 7.0.14
point1:613488 point2:613520
Output for hhvm-3.10.0 - 3.12.0
point1:2097152 point2:2097152
Output for 5.6.7 - 5.6.28
point1:1372080 point2:1372216
Output for 5.5.24 - 5.5.35
point1:1372080 point2:1372200
Output for 5.4.10 - 5.4.45
point1:1372616 point2:1372736
Output for 5.4.0 - 5.4.9
point1:1372072 point2:1372192
Output for 5.3.11 - 5.3.29
point1:2031528 point2:2031656
Output for 5.3.0 - 5.3.10
point1:2031208 point2:2031336
Output for 5.2.10 - 5.2.17
point1:1425128 point2:1425256
Output for 5.2.7 - 5.2.9
point1:1426728 point2:1426960
Output for 5.2.3 - 5.2.6
point1:1427048 point2:1427280
Output for 5.2.2
point1:1424968 point2:1425128
Output for 5.2.1
point1:1424432 point2:1424632
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/fDfBZ on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/fDfBZ on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/fDfBZ on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/fDfBZ on line 6