3v4l.org

run code in 300+ PHP versions simultaneously
<?php function build_array() { for ($i=0;$i<10000;$i++){ $a[$i]=$i; } $i=null; return $a; } echo memory_get_usage(false), PHP_EOL; $a = build_array(); echo memory_get_usage(false), PHP_EOL; unset($a); echo memory_get_usage(false), PHP_EOL;
Output for 7.3.0 - 7.3.1
387976 916448 388008
Output for 7.2.0 - 7.2.13
384120 912592 384152
Output for 7.1.25
347480 875952 347512
Output for 7.1.0, 7.1.7
347552 876024 347584
Output for 7.1.5 - 7.1.6
347768 876240 347800
Output for 7.0.0 - 7.0.20
347568 876040 347600
Output for 5.6.0 - 5.6.28
219168 1710640 219216
Output for 5.5.0 - 5.5.35
219168 1710624 219200

preferences:
75.93 ms | 414 KiB | 5 Q