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(); echo "\n"; 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.60.0140.00718.31
8.3.50.0070.01021.27
8.3.40.0090.00618.63
8.3.30.0070.00720.17
8.3.20.0090.00020.33
8.3.10.0070.00022.14
8.3.00.0050.00322.34
8.2.180.0110.00718.42
8.2.170.0110.00722.96
8.2.160.0070.00720.57
8.2.150.0050.00224.18
8.2.140.0120.00924.66
8.2.130.0130.00726.16
8.2.120.0080.00021.13
8.2.110.0050.00520.41
8.2.100.0080.00417.72
8.2.90.0060.00319.20
8.2.80.0030.00517.97
8.2.70.0030.00617.50
8.2.60.0020.00517.93
8.2.50.0000.00818.07
8.2.40.0000.00819.78
8.2.30.0000.01117.95
8.2.20.0000.00717.66
8.2.10.0000.00817.57
8.2.00.0000.00817.60
8.1.280.0160.00325.92
8.1.270.0080.00024.66
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0060.00323.91
8.1.230.0110.00022.15
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0040.00417.10
8.1.180.0000.00818.10
8.1.170.0070.00018.88
8.1.160.0000.00722.02
8.1.150.0040.00418.52
8.1.140.0000.00717.40
8.1.130.0000.00717.81
8.1.120.0030.00417.37
8.1.110.0000.00817.50
8.1.100.0040.00317.48
8.1.90.0040.00417.48
8.1.80.0080.00017.48
8.1.70.0000.00717.46
8.1.60.0040.00417.61
8.1.50.0040.00417.41
8.1.40.0090.00017.52
8.1.30.0000.00817.54
8.1.20.0000.00817.56
8.1.10.0000.00717.55
8.1.00.0040.00417.48
8.0.300.0050.00218.77
8.0.290.0070.00016.58
8.0.280.0070.00018.38
8.0.270.0000.01017.31
8.0.260.0030.00316.77
8.0.250.0070.00017.01
8.0.240.0030.00616.88
8.0.230.0040.00416.97
8.0.220.0030.00316.81
8.0.210.0000.00816.95
8.0.200.0000.00817.00
8.0.190.0030.00616.93
8.0.180.0040.00416.81
8.0.170.0040.00416.80
8.0.160.0070.00016.88
8.0.150.0040.00416.89
8.0.140.0000.00716.89
8.0.130.0060.00013.29
8.0.120.0080.00016.88
8.0.110.0000.00816.85
8.0.100.0030.00416.72
8.0.90.0050.00316.84
8.0.80.0090.01316.90
8.0.70.0030.00616.97
8.0.60.0040.00416.96
8.0.50.0000.00716.94
8.0.30.0110.01216.99
8.0.20.0120.00917.41
8.0.10.0080.00016.85
8.0.00.0080.01216.66
7.4.330.0000.00515.05
7.4.320.0000.00616.52
7.4.300.0040.00416.58
7.4.290.0040.00416.61
7.4.280.0030.00316.60
7.4.270.0070.00016.48
7.4.260.0070.00016.61
7.4.250.0070.00016.60
7.4.240.0000.00716.53
7.4.230.0030.00316.42
7.4.220.0130.01016.43
7.4.210.0070.00916.57
7.4.200.0000.00716.40
7.4.190.0000.00916.46
7.4.160.0110.01116.60
7.4.150.0100.01417.40
7.4.140.0140.00517.86
7.4.130.0090.01016.44
7.4.120.0100.00716.49
7.4.110.0130.00716.32
7.4.100.0140.00316.57
7.4.90.0030.01416.57
7.4.80.0060.01119.39
7.4.70.0030.01416.49
7.4.60.0100.00716.60
7.4.50.0030.00316.43
7.4.40.0060.00922.77
7.4.30.0040.01316.43
7.4.00.0000.01615.09
7.3.330.0020.00213.27
7.3.320.0060.00013.10
7.3.310.0000.00716.26
7.3.300.0000.00716.18
7.3.290.0070.00816.27
7.3.280.0060.01016.32
7.3.270.0150.00417.40
7.3.260.0100.00716.41
7.3.250.0050.01216.50
7.3.240.0090.00916.39
7.3.230.0090.01316.53
7.3.210.0100.01016.41
7.3.200.0100.00619.39
7.3.190.0100.00916.28
7.3.180.0070.00716.22
7.3.170.0120.00416.42
7.3.160.0110.00616.67
7.3.120.0030.01315.03
7.3.110.0070.00715.05
7.3.100.0090.00615.07
7.3.90.0070.00714.99
7.3.80.0100.00714.81
7.3.70.0030.01014.80
7.3.60.0100.00714.93
7.3.50.0070.00714.85
7.3.40.0060.00914.87
7.3.30.0080.00814.49
7.3.20.0090.00616.47
7.3.10.0050.00716.57
7.3.00.0070.00416.69
7.2.330.0150.00616.52
7.2.320.0070.01016.64
7.2.310.0180.00416.31
7.2.300.0170.00316.63
7.2.290.0110.01216.30
7.2.240.0100.00714.84
7.2.230.0030.01214.84
7.2.220.0070.01114.67
7.2.210.0110.00415.05
7.2.200.0000.01215.09
7.2.190.0070.00714.95
7.2.180.0000.01414.64
7.2.170.0090.00314.96
7.2.160.0000.01814.82
7.2.150.0060.00916.57
7.2.140.0040.00816.75
7.2.130.0060.01016.85
7.2.120.0090.00516.83
7.2.110.0180.00816.65
7.2.100.0050.00816.76
7.2.90.0090.00516.80
7.2.80.0060.00716.69
7.2.70.0060.00816.76
7.2.60.0070.00716.77
7.2.50.0040.00816.86
7.2.40.0080.00716.86
7.2.30.0060.00816.80
7.2.20.0050.00916.70
7.2.10.0050.01016.84
7.2.00.0090.00516.93
7.1.330.0070.00715.82
7.1.320.0100.00715.60
7.1.310.0070.00715.66
7.1.300.0080.00815.79
7.1.290.0030.01015.86
7.1.280.0070.00715.55
7.1.270.0000.01315.64
7.1.260.0000.01115.73
7.1.250.0060.00615.54
7.1.200.0030.00915.79
7.1.70.0040.00417.13
7.1.60.0160.00919.29
7.1.50.0030.01316.73
7.1.00.0000.05022.36
7.0.200.0170.00314.95
7.0.140.0070.07022.21
7.0.60.0100.05319.88
7.0.50.0100.05317.86
7.0.40.0130.03020.24
7.0.30.0200.04720.24
7.0.20.0270.08020.22
7.0.10.0230.07720.22
7.0.00.0070.08720.17
5.6.280.0070.07020.81
5.6.210.0100.04020.67
5.6.200.0030.04018.25
5.6.190.0000.04720.60
5.6.180.0330.07020.61
5.6.170.0230.05320.62
5.6.160.0000.04720.46
5.6.150.0070.07318.19
5.6.140.0070.08018.17
5.6.130.0100.07718.28
5.6.120.0100.05721.13
5.6.110.0100.05320.98
5.6.100.0070.08321.03
5.6.90.0100.08021.11
5.6.80.0070.06320.29
5.6.70.0170.06320.52
5.5.350.0130.07020.32
5.5.340.0070.03717.98
5.5.330.0070.07720.41
5.5.320.0200.05320.30
5.5.310.0270.06720.41
5.5.300.0070.06017.95
5.5.290.0100.03318.08
5.5.280.0130.05720.88
5.5.270.0030.04720.84
5.5.260.0030.04020.88
5.5.250.0170.07720.59
5.5.240.0200.06720.16
5.4.450.0670.06019.72
5.4.440.0930.07319.62
5.4.430.0570.07019.38
5.4.420.0100.05719.36
5.4.410.0930.04719.46
5.4.400.0230.05018.83
5.4.390.0200.06318.56
5.4.380.0200.05718.76
5.4.370.0170.05318.52
5.4.360.0200.05318.73
5.4.350.0160.07012.02
5.4.340.0110.04512.02
5.4.320.0080.03512.50
5.4.310.0050.03912.50
5.4.300.0050.03912.51
5.4.290.0060.03912.50
5.4.280.0040.03612.39
5.4.270.0040.03812.40
5.4.260.0070.03612.40
5.4.250.0000.06018.99
5.4.240.0070.05018.75
5.4.230.0130.04718.96
5.4.220.0100.05018.81
5.4.210.0130.05319.00
5.4.200.0100.05018.84
5.4.190.0130.04719.01
5.4.180.0130.04318.90
5.4.170.0100.05018.76
5.4.160.0070.05718.99
5.4.150.0070.05718.89
5.4.140.0070.05316.61
5.4.130.0000.05316.43
5.4.120.0230.04016.63
5.4.110.0130.05716.52
5.4.100.0000.05716.56
5.4.90.0030.05016.56
5.4.80.0100.04716.45
5.4.70.0030.05016.55
5.4.60.0100.05016.39
5.4.50.0070.06016.36
5.4.40.0030.05316.64
5.4.30.0130.04316.52
5.4.20.0000.06716.59
5.4.10.0130.04716.38
5.4.00.0130.05015.99
5.3.290.0070.03812.80
5.3.280.0030.05314.61
5.3.270.0100.05314.44
5.3.260.0100.05014.68
5.3.250.0070.05314.43
5.3.240.0100.07014.59
5.3.230.0070.05714.68
5.3.220.0200.04714.74
5.3.210.0030.05714.70
5.3.200.0170.04314.65
5.3.190.0030.06014.66
5.3.180.0100.05314.57
5.3.170.0130.05714.64
5.3.160.0070.05014.70
5.3.150.0200.05714.46
5.3.140.0000.08014.52
5.3.130.0070.06014.62
5.3.120.0030.05714.45
5.3.110.0070.05714.73
5.3.100.0100.04714.11
5.3.90.0030.05014.11
5.3.80.0030.05314.02
5.3.70.0100.05014.09
5.3.60.0070.05314.07
5.3.50.0070.04714.13
5.3.40.0030.05014.13
5.3.30.0100.04313.98
5.3.20.0130.05013.77
5.3.10.0070.04713.48
5.3.00.0030.06713.73
5.2.170.0130.03711.14
5.2.160.0030.04310.98
5.2.150.0070.04011.05
5.2.140.0070.04011.07
5.2.130.0070.03711.19
5.2.120.0130.03011.19
5.2.110.0130.03310.93
5.2.100.0070.04011.21
5.2.90.0000.04311.27
5.2.80.0170.03011.16
5.2.70.0100.03710.92
5.2.60.0070.04310.89
5.2.50.0070.04011.03
5.2.40.0100.03710.91
5.2.30.0030.05311.19
5.2.20.0130.04711.05
5.2.10.0000.04710.83
5.2.00.0070.04010.71
5.1.60.0070.03310.04
5.1.50.0030.04710.09
5.1.40.0130.0279.94
5.1.30.0000.04010.40
5.1.20.0070.03310.36
5.1.10.0030.0379.99
5.1.00.0070.03310.22
5.0.50.0070.0278.61
5.0.40.0030.0278.47
5.0.30.0000.0438.42
5.0.20.0030.0278.20
5.0.10.0070.0238.37
5.0.00.0130.0378.08
4.4.90.0030.0207.46
4.4.80.0000.0337.46
4.4.70.0030.0237.46
4.4.60.0000.0307.46
4.4.50.0030.0277.46
4.4.40.0030.0477.46
4.4.30.0030.0207.46
4.4.20.0070.0177.46
4.4.10.0000.0307.46
4.4.00.0000.0377.46
4.3.110.0000.0237.46
4.3.100.0000.0237.46
4.3.90.0000.0237.46
4.3.80.0000.0437.46
4.3.70.0100.0137.46
4.3.60.0030.0207.46
4.3.50.0070.0177.46
4.3.40.0000.0337.46
4.3.30.0000.0237.46
4.3.20.0000.0207.43
4.3.10.0030.0177.43
4.3.00.0170.0236.75

preferences:
41.66 ms | 401 KiB | 5 Q