3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { static $bar = 'test1'; echo $bar; if ($unset) { unset($bar); } } function test2($unset = false) { global $bar; if (!isset($bar)) { $bar = 'test2'; } echo $bar; if ($unset) { unset($bar); } } test1(); test1(); test1(true); test1(); test2(); test2(); test2(true); test2();

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)
8.3.70.0130.00918.27
8.3.60.0150.00618.40
8.3.50.0120.00621.15
8.3.40.0070.00718.75
8.3.30.0070.00720.17
8.3.20.0040.00420.13
8.3.10.0050.00321.92
8.3.00.0040.00422.51
8.2.190.0160.00716.63
8.2.180.0180.00416.59
8.2.170.0060.00922.96
8.2.160.0100.00320.38
8.2.150.0060.00324.18
8.2.140.0150.00424.66
8.2.130.0150.00426.16
8.2.120.0040.00419.66
8.2.110.0030.00622.25
8.2.100.0070.00419.21
8.2.90.0000.00819.22
8.2.80.0050.00319.32
8.2.70.0030.00617.38
8.2.60.0030.00517.80
8.2.50.0060.00318.07
8.2.40.0040.00417.91
8.2.30.0050.00217.97
8.2.20.0050.00317.55
8.2.10.0040.00417.76
8.2.00.0040.00417.57
8.1.280.0100.01025.92
8.1.270.0070.00024.66
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0090.00023.77
8.1.230.0070.00419.16
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.00
8.1.190.0080.00017.41
8.1.180.0080.00020.05
8.1.170.0080.00418.59
8.1.160.0040.00422.16
8.1.150.0000.00818.71
8.1.140.0040.00417.42
8.1.130.0030.00317.71
8.1.120.0040.00417.52
8.1.110.0000.00817.40
8.1.100.0040.00417.46
8.1.90.0050.00217.46
8.1.80.0040.00417.51
8.1.70.0070.00017.42
8.1.60.0040.00417.56
8.1.50.0000.00717.45
8.1.40.0030.00617.43
8.1.30.0000.00817.51
8.1.20.0050.00317.63
8.1.10.0000.00817.41
8.1.00.0040.00417.42
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0080.00018.39
8.0.270.0030.00617.18
8.0.260.0030.00316.77
8.0.250.0000.00716.97
8.0.240.0000.00816.92
8.0.230.0050.00216.86
8.0.220.0000.00716.92
8.0.210.0040.00416.89
8.0.200.0000.00716.92
8.0.190.0070.00416.93
8.0.180.0000.00716.81
8.0.170.0040.00416.75
8.0.160.0030.00416.77
8.0.150.0070.00016.73
8.0.140.0000.00716.80
8.0.130.0050.00013.32
8.0.120.0030.00516.90
8.0.110.0000.00816.87
8.0.100.0000.00716.84
8.0.90.0040.00416.71
8.0.80.0090.00916.78
8.0.70.0000.00816.92
8.0.60.0000.00816.79
8.0.50.0000.00716.94
8.0.30.0120.00717.03
8.0.20.0150.00517.40
8.0.10.0080.00016.86
8.0.00.0100.01016.67
7.4.330.0030.00315.00
7.4.320.0060.00016.56
7.4.300.0030.00316.59
7.4.290.0040.00416.50
7.4.280.0070.00016.49
7.4.270.0030.00316.61
7.4.260.0030.00316.59
7.4.250.0040.00416.57
7.4.240.0050.00216.53
7.4.230.0000.00716.40
7.4.220.0140.01016.55
7.4.210.0060.00916.48
7.4.200.0030.00316.64
7.4.190.0030.00616.52
7.4.160.0160.00616.52
7.4.150.0030.02017.40
7.4.140.0060.01317.86
7.4.130.0130.00616.48
7.4.120.0090.00816.48
7.4.110.0090.01516.55
7.4.100.0060.01116.68
7.4.90.0080.00816.54
7.4.80.0130.00319.39
7.4.70.0080.00816.60
7.4.60.0080.00916.49
7.4.50.0000.00416.54
7.4.40.0070.01122.77
7.4.30.0000.01716.70
7.4.00.0000.01314.98
7.3.330.0020.00213.09
7.3.320.0000.00613.24
7.3.310.0000.00716.21
7.3.300.0000.00716.33
7.3.290.0080.00816.29
7.3.280.0110.00516.29
7.3.270.0100.00617.40
7.3.260.0140.00416.33
7.3.250.0100.00816.47
7.3.240.0080.00816.39
7.3.230.0030.01516.64
7.3.210.0090.00916.36
7.3.200.0110.01119.39
7.3.190.0070.01316.59
7.3.180.0080.00816.48
7.3.170.0120.00916.48
7.3.160.0090.00916.64
7.3.120.0030.00914.82
7.2.330.0070.01416.48
7.2.320.0080.00916.59
7.2.310.0110.01116.30
7.2.300.0100.01316.40
7.2.290.0160.01016.66
7.2.00.0080.00419.26
7.1.100.0030.00618.30
7.1.70.0120.01217.19
7.1.60.0140.01119.29
7.1.50.0090.01516.99
7.1.00.0030.07722.28
7.0.200.0240.00314.80
7.0.140.0100.06721.97
7.0.60.0000.04319.93
7.0.50.0000.05017.84
7.0.40.0030.04320.13
7.0.30.0330.07020.14
7.0.20.0330.07720.15
7.0.10.0230.04020.10
7.0.00.0100.07720.06
5.6.210.0070.04320.69
5.6.200.0070.03718.14
5.6.190.0100.08020.61
5.6.180.0170.05320.44
5.6.170.0200.04020.55
5.6.160.0130.06020.46
5.6.150.0130.05318.12
5.6.140.0070.05318.15
5.6.130.0130.07718.15
5.6.120.0070.04321.13
5.6.110.0030.06021.14
5.6.100.0030.08721.04
5.6.90.0070.08721.04
5.6.80.0130.07320.39
5.6.70.0100.04320.29
5.5.350.0170.08020.41
5.5.340.0030.06318.07
5.5.330.0100.08320.43
5.5.320.0230.04320.32
5.5.310.0130.05020.19
5.5.300.0000.07717.97
5.5.290.0100.07717.98
5.5.280.0070.05320.87
5.5.270.0030.07320.65
5.5.260.0030.04320.66
5.5.250.0200.06320.69
5.5.240.0030.04020.16
5.4.450.0730.06019.62
5.4.440.0900.04719.63
5.4.430.0730.07019.61
5.4.420.0770.05319.44
5.4.410.0870.05319.50
5.4.400.0270.06318.71
5.4.390.0130.07018.63
5.4.380.0330.05318.63
5.4.370.0270.04718.55
5.4.360.0300.04318.44
5.4.350.0090.03712.02
5.4.340.0080.03512.02
5.4.320.0070.04012.50
5.4.310.0040.04012.50
5.4.300.0080.03512.51
5.4.290.0060.03812.50
5.4.280.0070.03412.40
5.4.270.0050.03712.40
5.4.260.0050.04212.40
5.4.250.0100.04718.98
5.4.240.0070.05018.84
5.4.230.0070.05319.02
5.4.220.0130.04718.80
5.4.210.0030.05718.79
5.4.200.0070.06719.01
5.4.190.0200.05319.02
5.4.180.0030.06018.77
5.4.170.0030.05718.93
5.4.160.0000.05718.95
5.4.150.0070.05318.96
5.4.140.0030.07316.44
5.4.130.0200.06316.40
5.4.120.0100.06716.41
5.4.110.0130.04716.54
5.4.100.0200.04316.61
5.4.90.0170.05316.44
5.4.80.0130.04016.52
5.4.70.0030.05316.55
5.4.60.0130.04316.41
5.4.50.0070.05016.49
5.4.40.0100.05016.55
5.4.30.0070.05016.46
5.4.20.0070.05016.46
5.4.10.0070.05316.59
5.4.00.0100.05016.00
5.3.290.0100.04312.80
5.3.280.0100.05014.61
5.3.270.0130.06714.71
5.3.260.0030.05714.73
5.3.250.0030.05314.60
5.3.240.0130.05014.77
5.3.230.0070.05014.81
5.3.220.0100.04714.63
5.3.210.0100.05014.65
5.3.200.0100.05714.55
5.3.190.0070.05314.74
5.3.180.0030.05714.72
5.3.170.0070.05714.74
5.3.160.0070.05014.56
5.3.150.0030.05714.58
5.3.140.0070.05014.65
5.3.130.0070.05314.71
5.3.120.0000.05714.63
5.3.110.0070.05314.62
5.3.100.0070.05014.03
5.3.90.0070.05014.11
5.3.80.0170.04014.19
5.3.70.0000.05714.10
5.3.60.0130.04314.22
5.3.50.0100.05714.12
5.3.40.0100.06714.06
5.3.30.0000.05713.98
5.3.20.0100.06713.78
5.3.10.0100.04313.73
5.3.00.0070.05013.47
5.2.170.0070.04011.14
5.2.160.0100.03711.12
5.2.150.0070.06011.14
5.2.140.0030.04311.23
5.2.130.0000.04311.18
5.2.120.0000.04711.09
5.2.110.0070.03711.18
5.2.100.0000.04311.07
5.2.90.0070.03711.20
5.2.80.0100.03311.27
5.2.70.0030.04311.07
5.2.60.0070.03711.14
5.2.50.0030.04311.10
5.2.40.0000.04311.08
5.2.30.0000.04311.14
5.2.20.0070.04011.04
5.2.10.0000.04310.95
5.2.00.0100.03310.71
5.1.60.0030.03310.10
5.1.50.0170.0339.96
5.1.40.0030.03710.04
5.1.30.0030.03310.40
5.1.20.0070.03710.19
5.1.10.0030.03710.05
5.1.00.0000.04010.11
5.0.50.0070.0238.39
5.0.40.0030.0278.25
5.0.30.0030.0608.32
5.0.20.0000.0308.25
5.0.10.0000.0308.15
5.0.00.0000.0408.08
4.4.90.0000.0237.43
4.4.80.0000.0237.43
4.4.70.0000.0237.43
4.4.60.0000.0237.43
4.4.50.0070.0177.43
4.4.40.0000.0337.43
4.4.30.0070.0207.43
4.4.20.0030.0207.43
4.4.10.0000.0237.43
4.4.00.0000.0377.43
4.3.110.0000.0337.43
4.3.100.0070.0177.43
4.3.90.0000.0207.43
4.3.80.0000.0337.43
4.3.70.0000.0207.43
4.3.60.0000.0277.43
4.3.50.0000.0237.43
4.3.40.0070.0277.43
4.3.30.0000.0237.43
4.3.20.0030.0207.43
4.3.10.0000.0237.43
4.3.00.0130.0306.75

preferences:
44.39 ms | 401 KiB | 5 Q