3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getMem() { return memory_get_usage(true) / 1024; } $array = range(1, 1000); shuffle($array); $mem = getMem(); $string = compress($array); echo 'You used : ', getMem() - $mem, ' Kb', PHP_EOL; function compress($array) { return gzdeflate(base64_encode(implode(',', $array)), 9); } function uncompress($data) { return explode(',', base64_decode(gzinflate($data))); } file_put_contents('demo', $string); $uncompress = uncompress($string); for ($i = 0; $i < 100; $i++) { $test = rand(0, 1000000 - 1); if ($array[$test] != $uncompress[$test]) { die('You failed!!!'); } } echo 'You Win', PHP_EOL; echo date('Y-m-d H:i:s'), PHP_EOL;

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.00.0030.01019.39
7.1.70.0060.00317.34
7.1.60.0030.01019.70
7.1.50.0190.00616.98
7.1.00.0000.08322.45
7.0.200.0060.00316.98
7.0.140.0070.07022.01
7.0.90.0170.06320.18
7.0.80.0100.08020.17
7.0.70.0100.07720.14
7.0.60.0430.05320.50
7.0.50.0370.05320.91
7.0.40.0130.07720.43
7.0.30.0100.07720.34
7.0.20.0170.07320.35
7.0.10.0030.09020.50
7.0.00.0200.05020.45
5.6.280.0030.07721.45
5.6.240.0170.07021.08
5.6.230.0100.07720.84
5.6.220.0070.09020.80
5.6.210.0100.07720.95
5.6.200.0030.05021.37
5.6.190.0100.06321.30
5.6.180.0100.04721.50
5.6.170.0030.05321.29
5.6.160.0030.09321.35
5.6.150.0070.05021.41
5.6.140.0070.04721.39
5.6.130.0100.08021.38
5.6.120.0070.08021.36
5.6.110.0070.04721.41
5.6.100.0070.08321.34
5.6.90.0070.05021.40
5.6.80.0030.06320.79
5.6.70.0000.04320.76
5.6.60.0000.09020.79
5.6.50.0000.04720.77
5.6.40.0030.06020.81
5.6.30.0030.06720.71
5.6.20.0000.04020.70
5.6.10.0070.04020.85
5.6.00.0070.04720.71
5.5.380.0070.08020.83
5.5.370.0130.07320.71
5.5.360.0070.09020.82
5.5.350.0000.08020.79
5.5.340.0070.08021.20
5.5.330.0100.07021.17
5.5.320.0100.08321.25
5.5.310.0030.08721.16
5.5.300.0200.07021.17
5.5.290.0130.06021.14
5.5.280.0100.07721.25
5.5.270.0070.07721.10
5.5.260.0070.04721.13
5.5.250.0070.03720.95
5.5.240.0130.06320.55
5.5.230.0070.03720.64
5.5.220.0030.04020.60
5.5.210.0030.04020.50
5.5.200.0030.04720.30
5.5.190.0000.04320.61
5.5.180.0070.04320.57
5.5.160.0000.05720.45
5.5.150.0100.03320.57
5.5.140.0030.04020.32
5.5.130.0070.04020.47
5.5.120.0070.04020.58
5.5.110.0030.03720.41
5.5.100.0030.04320.41
5.5.90.0030.06020.48
5.5.80.0030.06720.46
5.5.70.0030.04320.48
5.5.60.0070.07720.49
5.5.50.0130.07320.48
5.5.40.0170.07320.45
5.5.30.0100.08320.41
5.5.20.0030.07320.36
5.5.10.0100.05720.34
5.5.00.0100.08020.38
5.4.450.0100.05319.66
5.4.440.0030.04719.70
5.4.430.0000.04319.44
5.4.420.0030.04719.62
5.4.410.0030.04319.41
5.4.400.0030.03719.16
5.4.390.0030.04019.48
5.4.380.0070.03319.38
5.4.370.0000.05019.16
5.4.360.0100.03319.32
5.4.350.0000.04319.45
5.4.340.0030.04719.32
5.4.320.0000.04319.26
5.4.310.0100.03319.22
5.4.300.0070.03319.29
5.4.290.0070.06019.12
5.4.280.0030.04019.17
5.4.270.0030.07719.12
5.4.260.0030.04019.48
5.4.250.0070.03319.37
5.4.240.0070.03319.16
5.4.230.0070.05719.12
5.4.220.0030.07719.29
5.4.210.0030.07719.23
5.4.200.0030.07719.36
5.4.190.0030.08019.29
5.4.180.0130.06719.29
5.4.170.0030.07319.16
5.4.160.0070.07019.36
5.4.150.0030.08719.30
5.4.140.0070.06716.69
5.4.130.0030.08016.57
5.4.120.0030.07716.73
5.4.110.0070.04016.76
5.4.100.0130.06316.66
5.4.90.0070.07716.61
5.4.80.0030.07016.69
5.4.70.0000.05016.68
5.4.60.0000.08016.73
5.4.50.0100.07016.71
5.4.40.0170.06016.79
5.4.30.0130.06716.62
5.4.20.0030.06716.57
5.4.10.0000.08016.66
5.4.00.0130.07316.13
5.3.290.0030.03715.09
5.3.280.0030.06715.14
5.3.270.0070.08015.18
5.3.260.0130.06315.02
5.3.250.0130.06314.99
5.3.240.0030.08315.06
5.3.230.0100.06315.06
5.3.220.0070.06315.05
5.3.210.0030.07714.98
5.3.200.0100.07714.98
5.3.190.0130.07314.96
5.3.180.0100.06715.01
5.3.170.0000.04315.07
5.3.160.0070.07315.02
5.3.150.0100.07015.02
5.3.140.0100.07314.95
5.3.130.0170.07315.13
5.3.120.0070.08015.11
5.3.110.0070.06715.10
5.3.100.0100.07714.50
5.3.90.0000.04314.45
5.3.80.0070.07714.46
5.3.70.0030.05314.53
5.3.60.0030.04314.51
5.3.50.0000.07314.43
5.3.40.0070.07714.39
5.3.30.0100.06714.32
5.3.20.0000.07714.20
5.3.10.0070.04314.04
5.3.00.0170.06314.16

preferences:
35.15 ms | 401 KiB | 5 Q