3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test1($unset = false) { static $bar = 0; $bar++; echo $bar; if ($unset) { // removes var from scope but value remains unset($bar); $bar = 10; } } test1(); test1(); test1(true); test1();

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.2.60.0030.00916.77
7.2.00.0030.01319.07
7.1.200.0090.00315.72
7.1.100.0080.00618.31
7.1.70.0060.00316.95
7.1.60.0030.02219.29
7.1.50.0060.01616.86
7.1.00.0000.05022.29
7.0.200.0100.00714.71
7.0.140.0000.07721.92
7.0.60.0100.05019.87
7.0.50.0030.07017.95
7.0.40.0000.07320.18
7.0.30.0270.07320.34
7.0.20.0330.08020.15
7.0.10.0030.04320.26
7.0.00.0070.04320.11
5.6.210.0070.06020.71
5.6.200.0000.05018.19
5.6.190.0130.08320.61
5.6.180.0300.04720.58
5.6.170.0200.03720.47
5.6.160.0070.08720.55
5.6.150.0000.04018.21
5.6.140.0100.06318.22
5.6.130.0070.04018.28
5.6.120.0170.06021.14
5.6.110.0130.06321.12
5.6.100.0100.08720.96
5.6.90.0070.05720.97
5.6.80.0100.07320.40
5.6.70.4070.03720.38
5.5.350.0130.08020.47
5.5.340.0030.04317.99
5.5.330.0070.04320.31
5.5.320.0170.04720.34
5.5.310.0200.07320.27
5.5.300.0030.08317.98
5.5.290.0030.04317.94
5.5.280.0170.07720.95
5.5.270.0170.07320.63
5.5.260.0070.08320.89
5.5.250.0100.07020.66
5.5.240.0330.09320.28
5.4.450.0000.07019.32
5.4.440.0930.05319.46
5.4.430.0800.05719.48
5.4.420.0830.04719.70
5.4.410.0700.05719.17
5.4.400.0330.05318.50
5.4.390.0170.06718.46
5.4.380.0130.06318.81
5.4.370.0230.04718.77
5.4.360.0200.05318.55
5.4.350.0090.04612.02
5.4.340.0090.04512.01
5.4.320.0060.04112.51
5.4.310.0100.05312.50
5.4.300.0090.04212.50
5.4.290.0050.03912.50
5.4.280.0070.04112.40
5.4.270.0040.04312.40
5.4.260.0050.04612.40
5.4.250.0230.04018.96
5.4.240.0170.06719.03
5.4.230.0200.06018.77
5.4.220.0100.08318.90
5.4.210.0100.05019.02
5.4.200.0100.05019.00
5.4.190.0130.06019.02
5.4.180.0030.06318.74
5.4.170.0130.04718.90
5.4.160.0100.05018.75
5.4.150.0170.07018.95
5.4.140.0170.05716.39
5.4.130.0130.04316.38
5.4.120.0130.06716.50
5.4.110.0070.05716.49
5.4.100.0100.05316.52
5.4.90.0070.05316.36
5.4.80.0070.05016.63
5.4.70.0000.05716.49
5.4.60.0170.04716.48
5.4.50.0100.04716.59
5.4.40.0100.05716.49
5.4.30.0070.05316.33
5.4.20.0130.04316.43
5.4.10.0070.05016.49
5.4.00.0030.05016.02
5.3.290.0050.04512.80
5.3.280.0170.06714.67
5.3.270.0100.07314.57
5.3.260.0130.05014.68
5.3.250.0000.06014.69
5.3.240.0100.05314.69
5.3.230.0130.06314.42
5.3.220.0230.03314.55
5.3.210.0100.05014.57
5.3.200.0170.04714.64
5.3.190.0130.05014.53
5.3.180.0100.04714.78
5.3.170.0070.05314.54
5.3.160.0130.05314.54
5.3.150.0030.06014.64
5.3.140.0130.07014.52
5.3.130.0070.08014.62
5.3.120.0200.04714.61
5.3.110.0070.05014.61
5.3.100.0030.05314.12
5.3.90.0130.06714.02
5.3.80.0030.05314.11
5.3.70.0070.05014.11
5.3.60.0070.06714.07
5.3.50.0130.06014.02
5.3.40.0170.04014.03
5.3.30.0100.04013.97
5.3.20.0100.04713.77
5.3.10.0070.04713.80
5.3.00.0030.05013.73
5.2.170.0100.05711.21
5.2.160.0100.03311.13
5.2.150.0030.04011.15
5.2.140.0000.04711.21
5.2.130.0030.04311.07
5.2.120.0070.03711.27
5.2.110.0100.03711.17
5.2.100.0030.04011.09
5.2.90.0130.05711.31
5.2.80.0170.04311.07
5.2.70.0070.03710.98
5.2.60.0070.05311.13
5.2.50.0000.04711.07
5.2.40.0000.04311.07
5.2.30.0070.04011.05
5.2.20.0100.03710.93
5.2.10.0100.03710.84
5.2.00.0130.04310.79
5.1.60.0000.03710.09
5.1.50.0100.0439.95
5.1.40.0030.0379.96
5.1.30.0100.03010.41
5.1.20.0030.03710.17
5.1.10.0100.03710.26
5.1.00.0030.04010.13
5.0.50.0070.0238.60
5.0.40.0000.0308.34
5.0.30.0030.0438.31
5.0.20.0030.0278.43
5.0.10.0030.0278.13
5.0.00.0070.0408.23
4.4.90.0070.0177.54
4.4.80.0000.0237.54
4.4.70.0030.0237.54
4.4.60.0000.0237.54
4.4.50.0000.0237.54
4.4.40.0000.0377.54
4.4.30.0000.0237.54
4.4.20.0030.0277.54
4.4.10.0030.0207.54
4.4.00.0000.0437.54
4.3.110.0070.0307.54
4.3.100.0070.0207.54
4.3.90.0070.0177.54
4.3.80.0000.0377.54
4.3.70.0030.0237.54
4.3.60.0000.0237.54
4.3.50.0030.0207.54
4.3.40.0170.0277.54
4.3.30.0000.0307.54
4.3.20.0030.0277.54
4.3.10.0000.0277.54
4.3.00.0170.0176.75