3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { // PHP establishes an internal static var and binds // the local name 'bar' to it static $bar = 0; // unlink the name 'bar' from the internal static var unset($bar); // we can reuse $bar! $bar = "reusing!"; echo $bar; // rebind 'bar' to the internal static var! static $bar; $bar++; echo $bar; } test1(); test1(); test1(); 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).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.40.0100.00718.71
8.3.30.0000.01420.34
8.3.20.0070.00020.16
8.3.10.0040.00421.92
8.3.00.0000.00822.40
8.2.170.0170.00322.96
8.2.160.0140.00320.52
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0150.00626.16
8.2.120.0040.00419.66
8.2.110.0080.00420.38
8.2.100.0070.00419.39
8.2.90.0000.00719.08
8.2.80.0060.00319.38
8.2.70.0090.00017.38
8.2.60.0050.00317.93
8.2.50.0050.00318.07
8.2.40.0040.00419.95
8.2.30.0090.00018.21
8.2.20.0000.00817.65
8.2.10.0050.00217.63
8.2.00.0000.00817.74
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.75
8.1.230.0040.00818.97
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0080.00017.53
8.1.180.0000.00720.13
8.1.170.0000.00818.50
8.1.160.0020.00522.14
8.1.150.0040.00418.64
8.1.140.0050.00217.43
8.1.130.0000.00717.95
8.1.120.0030.00317.36
8.1.110.0020.00517.44
8.1.100.0030.00517.46
8.1.90.0070.00017.40
8.1.80.0070.00017.30
8.1.70.0030.00317.27
8.1.60.0040.00417.60
8.1.50.0000.00717.42
8.1.40.0080.00017.57
8.1.30.0040.00417.60
8.1.20.0080.00017.54
8.1.10.0040.00417.52
8.1.00.0000.00917.41
8.0.300.0000.00718.77
8.0.290.0070.00017.16
8.0.280.0070.00018.36
8.0.270.0060.00317.24
8.0.260.0030.00316.87
8.0.250.0000.00716.96
8.0.240.0050.00316.95
8.0.230.0040.00416.94
8.0.220.0000.00716.85
8.0.210.0030.00416.92
8.0.200.0040.00416.91
8.0.190.0030.00616.98
8.0.180.0030.00616.97
8.0.170.0030.00616.85
8.0.160.0050.00316.90
8.0.150.0070.00016.73
8.0.140.0040.00416.87
8.0.130.0000.00613.36
8.0.120.0000.00816.77
8.0.110.0050.00216.85
8.0.100.0000.00716.77
8.0.90.0000.00716.77
8.0.80.0090.00516.82
8.0.70.0000.00816.84
8.0.60.0070.00017.01
8.0.50.0000.00816.94
8.0.30.0120.00617.03
8.0.20.0120.00717.40
8.0.10.0040.00416.97
8.0.00.0070.01016.75
7.4.330.0000.00515.03
7.4.320.0000.00616.49
7.4.300.0000.00616.64
7.4.290.0000.00716.50
7.4.280.0030.00316.45
7.4.270.0040.00216.36
7.4.260.0070.00016.49
7.4.250.0080.00016.51
7.4.240.0030.00516.44
7.4.230.0000.00616.58
7.4.220.0030.01416.41
7.4.210.0080.00716.53
7.4.200.0030.00316.48
7.4.190.0000.00816.52
7.4.160.0120.00316.47
7.4.150.0120.00517.40
7.4.140.0050.01317.86
7.4.130.0120.00616.41
7.4.120.0090.01016.53
7.4.110.0120.01216.54
7.4.100.0150.00716.64
7.4.90.0110.00616.41
7.4.80.0100.01019.39
7.4.70.0030.01216.52
7.4.60.0080.00816.56
7.4.50.0060.00316.10
7.4.40.0100.00622.77
7.4.30.0120.00416.32
7.4.00.0050.01215.07
7.3.330.0000.00513.21
7.3.320.0050.00013.05
7.3.310.0070.00016.14
7.3.300.0030.00316.24
7.3.290.0090.00616.27
7.3.280.0130.00616.28
7.3.270.0100.00717.40
7.3.260.0110.00516.49
7.3.250.0080.01016.31
7.3.240.0120.00916.60
7.3.230.0140.00316.56
7.3.210.0110.00616.42
7.3.200.0100.00719.39
7.3.190.0140.00716.58
7.3.180.0080.00816.23
7.3.170.0080.00816.41
7.3.160.0110.00416.30
7.3.120.0050.01014.96
7.3.110.0080.00814.44
7.3.100.0040.00814.59
7.3.90.0060.00614.76
7.3.80.0000.01514.58
7.3.70.0100.00714.91
7.3.60.0030.01314.78
7.3.50.0030.00714.95
7.3.40.0100.01014.92
7.3.30.0060.00614.87
7.3.20.0000.01216.77
7.3.10.0070.01016.57
7.3.00.0060.00816.61
7.2.330.0160.00316.56
7.2.320.0100.01016.41
7.2.310.0120.00316.65
7.2.300.0030.01316.68
7.2.290.0160.00716.68
7.2.250.0060.01114.84
7.2.240.0090.00915.14
7.2.230.0070.01115.14
7.2.220.0030.00914.68
7.2.210.0060.01015.12
7.2.200.0070.00715.06
7.2.190.0030.01214.84
7.2.180.0040.01214.94
7.2.170.0110.01114.71
7.2.00.0000.01519.35
7.1.330.0070.00715.73
7.1.320.0060.00315.80
7.1.310.0040.00715.55
7.1.300.0090.00015.72
7.1.290.0090.00615.66
7.1.280.0040.01115.76
7.1.270.0040.00715.63
7.1.260.0080.00515.48
7.1.100.0120.00618.11
7.1.70.0040.00417.22
7.1.60.0070.00416.86
7.1.50.0100.01016.99
7.1.00.0000.03722.49
7.0.200.0070.01016.35
7.0.140.0130.06721.97
7.0.60.0130.08020.04
7.0.50.0030.07317.85
7.0.40.0100.05020.14
7.0.30.0370.07720.09
7.0.20.0330.07020.12
7.0.10.0270.07020.07
7.0.00.0070.08320.09
5.6.280.0030.07320.99
5.6.210.0070.04320.62
5.6.200.0070.03718.23
5.6.190.0100.03720.63
5.6.180.0330.07020.77
5.6.170.0400.06320.45
5.6.160.0070.06720.57
5.6.150.0070.07718.28
5.6.140.0070.06718.23
5.6.130.0070.08018.17
5.6.120.0070.05320.97
5.6.110.0030.08721.10
5.6.100.0070.08720.89
5.6.90.0000.09021.11
5.6.80.0070.04720.40
5.6.70.0270.06320.35
5.5.350.0130.08020.45
5.5.340.0100.07317.93
5.5.330.0000.04720.29
5.5.320.0200.04020.32
5.5.310.0330.07020.36
5.5.300.0030.08318.00
5.5.290.0000.04318.04
5.5.280.0070.04720.77
5.5.270.0100.08020.61
5.5.260.0030.04020.87
5.5.250.0070.07720.61
5.5.240.0100.06720.29
5.4.450.0800.07019.58
5.4.440.0630.06019.45
5.4.430.0030.07319.38
5.4.420.0870.05019.46
5.4.410.0570.06019.50
5.4.400.0230.06718.63
5.4.390.0070.07018.75
5.4.380.0230.05318.59
5.4.370.0200.05318.62
5.4.360.0300.05318.79
5.4.350.0080.03912.02
5.4.340.0040.03912.02
5.4.320.0040.04012.50
5.4.310.0070.03712.50
5.4.300.0050.03912.50
5.4.290.0070.03912.50
5.4.280.0070.03612.40
5.4.270.0090.03812.39
5.4.260.0070.04212.40
5.4.250.0070.05718.98
5.4.240.0130.04718.89
5.4.230.0100.07718.67
5.4.220.0170.06718.64
5.4.210.0070.07318.88
5.4.200.0100.06018.84
5.4.190.0230.05318.66
5.4.180.0100.06018.84
5.4.170.0070.07318.86
5.4.160.0170.05318.86
5.4.150.0230.07018.86
5.4.140.0100.05316.45
5.4.130.0100.07016.32
5.4.120.0100.06716.34
5.4.110.0070.06016.42
5.4.100.0070.06716.65
5.4.90.0100.06716.61
5.4.80.0170.05716.52
5.4.70.0100.05016.40
5.4.60.0130.06716.54
5.4.50.0100.06316.49
5.4.40.0030.05716.48
5.4.30.0030.05016.45
5.4.20.0070.04716.52
5.4.10.0070.05316.49
5.4.00.0070.05715.92
5.3.290.0080.03712.80
5.3.280.0170.06014.77
5.3.270.0130.07014.74
5.3.260.0000.08314.66
5.3.250.0230.04714.62
5.3.240.0100.06314.68
5.3.230.0070.06014.58
5.3.220.0000.06014.58
5.3.210.0130.05314.74
5.3.200.0100.06714.56
5.3.190.0130.06314.54
5.3.180.0070.06314.55
5.3.170.0070.05014.53
5.3.160.0070.06314.69
5.3.150.0030.06314.48
5.3.140.0070.05014.71
5.3.130.0000.06714.73
5.3.120.0170.06314.63
5.3.110.0030.06014.63
5.3.100.0170.06014.11
5.3.90.0070.05014.10
5.3.80.0070.06714.09
5.3.70.0100.06014.10
5.3.60.0100.05314.09
5.3.50.0100.04714.11
5.3.40.0070.07714.04
5.3.30.0130.06313.98
5.3.20.0100.05713.69
5.3.10.0130.04013.84
5.3.00.0130.06013.63
5.2.170.0100.05711.23
5.2.160.0100.05311.14
5.2.150.0130.03311.36
5.2.140.0000.04711.09
5.2.130.0030.04711.09
5.2.120.0130.04310.93
5.2.110.0070.04711.17
5.2.100.0130.03311.31
5.2.90.0100.03711.16
5.2.80.0030.04311.05
5.2.70.0030.04311.14
5.2.60.0030.04311.14
5.2.50.0100.05011.11
5.2.40.0100.03310.97
5.2.30.0070.04311.14
5.2.20.0100.05011.02
5.2.10.0170.03010.96
5.2.00.0100.05010.89
5.1.60.0000.0379.97
5.1.50.0000.0539.95
5.1.40.0070.0309.93
5.1.30.0030.03710.54
5.1.20.0100.03710.43
5.1.10.0070.03310.21
5.1.00.0070.03710.05
5.0.50.0030.0308.61
5.0.40.0070.0378.49
5.0.30.0030.0578.28
5.0.20.0000.0308.17
5.0.10.0030.0278.37
5.0.00.0030.0438.07
4.4.90.0000.0237.40
4.4.80.0030.0207.40
4.4.70.0070.0177.40
4.4.60.0030.0207.40
4.4.50.0000.0237.40
4.4.40.0000.0377.40
4.4.30.0030.0207.40
4.4.20.0100.0237.40
4.4.10.0030.0307.40
4.4.00.0100.0377.40
4.3.110.0070.0177.40
4.3.100.0030.0207.40
4.3.90.0070.0137.40
4.3.80.0000.0337.40
4.3.70.0030.0207.40
4.3.60.0000.0237.40
4.3.50.0000.0237.40
4.3.40.0030.0307.40
4.3.30.0030.0237.40
4.3.20.0000.0237.40
4.3.10.0000.0277.40
4.3.00.0170.0236.75

preferences:
42.79 ms | 400 KiB | 5 Q