3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getRandomStr($length){ return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length); } $start = microtime(true); // Mixed could theoretically be an object or an array. // In this example it's an array. $mixed = array(); for($i = 0; $i < 100; $i++) { if (is_array($mixed)) { $mixed[getRandomStr(15)] = 'abcd'; } else { // Do something else which we don't care about here } } print round(microtime(true) - $start, 2) . 's';

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0030.00717.33
7.1.60.0180.00619.82
7.1.50.0150.01117.05
7.1.00.0100.07022.43
7.0.200.0060.00916.69
7.0.140.0030.07322.09
7.0.60.0030.04019.94
7.0.50.0030.08717.90
7.0.40.0130.03320.23
7.0.30.0270.03320.23
7.0.20.0200.08320.15
7.0.10.0170.07720.08
7.0.00.0070.05020.06
5.6.280.0030.07320.91
5.6.210.0100.06320.71
5.6.200.0130.04018.18
5.6.190.0030.07020.55
5.6.180.0270.03720.61
5.6.170.0370.06720.62
5.6.160.0030.05320.43
5.6.150.0130.05318.28
5.6.140.0170.06718.14
5.6.130.0000.09018.15
5.6.120.0000.05720.99
5.6.110.0070.08321.13
5.6.100.0130.07720.98
5.6.90.0030.04320.99
5.6.80.0070.07320.38
5.5.350.4530.04020.53
5.5.340.0030.07717.98
5.5.330.0130.07720.57
5.5.320.0430.07720.27
5.5.310.0270.06320.40
5.5.300.0100.08017.98
5.5.290.0070.07318.06
5.5.280.0130.05720.87
5.5.270.0130.08020.96
5.5.260.0000.04320.98
5.5.250.0100.04320.70
5.5.240.0370.06320.07
5.4.450.0200.04019.41
5.4.440.0170.07719.56
5.4.430.0200.04019.46
5.4.420.0100.04019.38
5.4.410.0170.07019.45
5.4.400.0100.06719.11
5.4.390.0130.05319.09
5.4.380.0130.07319.23
5.4.370.0170.03718.98
5.4.360.0130.07319.16
5.4.350.0200.07018.87
5.4.340.0130.05319.29
5.4.320.0130.05319.15
5.4.310.0270.03718.84
5.4.300.0270.03319.21
5.4.290.0200.06719.14
5.4.280.0130.06019.05
5.4.270.0270.03719.23
5.4.260.0130.06019.05
5.4.250.0100.04018.98
5.4.240.0200.04319.25
5.4.230.0100.05019.23
5.4.220.0170.03319.20
5.4.210.0130.05718.86
5.4.200.0200.03018.86
5.4.190.0170.06719.20
5.4.180.0170.05018.87
5.4.170.0200.07018.87
5.4.160.0070.07719.23
5.4.150.0270.04019.04
5.4.140.0200.06016.41
5.4.130.0170.07016.71
5.4.120.0100.07316.36
5.4.110.0130.04016.68
5.4.100.0170.03016.60
5.4.90.0100.04016.49
5.4.80.0170.07016.45
5.4.70.0130.07316.62
5.4.60.0030.06716.38
5.4.50.0130.05016.41
5.4.40.0230.05316.35
5.4.30.0070.05016.37
5.4.20.0100.03716.38
5.4.10.0170.07016.52
5.4.00.0070.05316.01
5.3.290.0230.05014.76
5.3.280.0200.05314.57
5.3.270.0100.04014.59
5.3.260.0100.04014.60
5.3.250.0130.06014.76
5.3.240.0100.05714.62
5.3.230.0170.04014.61
5.3.220.0130.07014.63
5.3.210.0130.03714.69
5.3.200.0070.07014.66
5.3.190.0270.05014.54
5.3.180.0130.06314.54
5.3.170.0170.03314.66
5.3.160.0130.03714.72
5.3.150.0130.03314.64
5.3.140.0170.04314.68
5.3.130.0170.03714.63
5.3.120.0170.07314.54
5.3.110.0130.07714.67
5.3.100.0070.05314.19
5.3.90.0130.05314.03
5.3.80.0170.04314.07
5.3.70.0170.06714.15
5.3.60.0130.07014.02
5.3.50.0130.05714.07
5.3.40.0230.04013.95
5.3.30.0170.03014.07
5.3.20.0200.04713.95
5.3.10.0100.04013.95
5.3.00.0100.05013.95
5.2.170.0200.05713.95
5.2.160.0100.05313.95
5.2.150.0170.02313.95
5.2.140.0100.04013.95
5.2.130.0170.02313.95
5.2.120.0070.05313.95
5.2.110.0130.04313.95
5.2.100.0100.06013.95
5.2.90.0070.03013.95
5.2.80.0070.06013.95
5.2.70.0100.06313.95
5.2.60.0170.04013.95
5.2.50.0130.06013.95
5.2.40.0030.05013.95
5.2.30.0100.05713.95
5.2.20.0170.05013.95
5.2.10.0170.05013.95
5.2.00.0030.05313.95
5.1.60.0030.03713.95
5.1.50.0030.03313.95
5.1.40.0130.04313.95
5.1.30.0100.06013.95
5.1.20.0070.02313.95
5.1.10.0070.03313.95
5.1.00.0070.04713.95
5.0.50.0030.04013.95
5.0.40.0030.04313.95
5.0.30.0070.05713.95
5.0.20.0000.03713.95
5.0.10.0030.03713.95
5.0.00.0070.04713.95
4.4.90.0030.03313.95
4.4.80.0000.01713.95
4.4.70.0030.02313.95
4.4.60.0030.02013.95
4.4.50.0100.01313.95
4.4.40.0000.02713.95
4.4.30.0000.01713.95
4.4.20.0030.03313.95
4.4.10.0030.03313.95
4.4.00.0000.02713.95
4.3.110.0000.01713.95
4.3.100.0070.02013.95
4.3.90.0030.02013.95
4.3.80.0030.02013.95
4.3.70.0000.01713.95
4.3.60.0070.03013.95
4.3.50.0070.03013.95
4.3.40.0030.04013.95
4.3.30.0070.03013.95
4.3.20.0030.03013.95
4.3.10.0000.02713.95
4.3.00.0070.02313.95