3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NonLeakingClass { } function test(){ $ret = []; for($i=0;$i<100000;$i++){ $ret[]= new NonLeakingClass(); } return $ret; } $i=0; echo "test?".PHP_EOL; echo memory_get_usage()."\n"; while($i++<10){ if($i==1){ $a=test(); echo memory_get_usage()."\n"; unset($a); } echo memory_get_usage()."\n"; } gc_collect_cycles(); echo memory_get_usage()."\n";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.101.1490.02322.43
7.2.92.9870.01322.88
7.2.82.1600.02622.54
7.2.70.6650.02023.00
7.2.61.9240.02022.98
7.2.51.5610.02322.90
7.2.42.1710.01622.66
7.2.32.5470.01020.93
7.2.20.4540.02922.96
7.2.10.8500.02022.66
7.2.00.3460.02022.88
7.1.210.2580.02221.61
7.1.202.5880.01021.66
7.1.190.8210.02021.80
7.1.181.8790.02021.52
7.1.171.8470.01321.96
7.1.162.4260.00921.63
7.1.152.6230.01321.79
7.1.140.8080.02321.79
7.1.130.3100.01621.49
7.1.121.3160.02321.98
7.1.110.7020.02021.92
7.1.100.4480.03621.90
7.1.91.1070.02321.70
7.1.81.1280.02321.85
7.1.71.2390.02921.81
7.1.61.2800.02339.96
7.1.51.5140.02340.10
7.1.41.5430.01639.92
7.1.31.4060.02039.80
7.1.21.4370.02039.81
7.1.11.5460.01621.82
7.1.01.5430.01321.47

preferences:
32.7 ms | 400 KiB | 5 Q