3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sum = null; // global variable function outer() { global $sum; $hundred_more = 100; $sum = function ($a, $b) use ($hundred_more) { return $a + $b + (++$hundred_more); }; print($hundred_more); } outer(); // define sum at the global scope and print 100 echo($sum(5, 10)); // 116 echo($sum(5, 10)); // 117 outer(); // redefine sum at the global scope and print 100 echo($sum(5, 10)); // 116 echo($sum(5, 10)); // 117

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.0120.00318.56
8.3.60.0070.00718.43
8.3.50.0110.01121.11
8.3.40.0160.00018.78
8.3.30.0090.00619.04
8.3.20.0040.00420.13
8.3.10.0040.00423.46
8.3.00.0080.00019.35
8.2.190.0070.01416.75
8.2.180.0080.00818.29
8.2.170.0100.00322.96
8.2.160.0070.00720.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.01422.23
8.2.110.0000.00920.52
8.2.100.0060.00618.09
8.2.90.0050.00219.09
8.2.80.0030.00517.97
8.2.70.0030.00617.50
8.2.60.0090.00017.93
8.2.50.0030.00618.07
8.2.40.0040.00419.95
8.2.30.0000.00718.13
8.2.20.0000.00717.64
8.2.10.0040.00418.13
8.2.00.0040.00417.63
8.1.280.0070.01025.92
8.1.270.0030.00524.01
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.79
8.1.230.0030.00719.15
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0090.00017.13
8.1.190.0000.00817.23
8.1.180.0050.00318.10
8.1.170.0040.00418.66
8.1.160.0000.00722.03
8.1.150.0080.00018.89
8.1.140.0040.00417.46
8.1.130.0030.00317.84
8.1.120.0000.00717.48
8.1.110.0040.00417.35
8.1.100.0040.00417.52
8.1.90.0070.00017.48
8.1.80.0040.00417.43
8.1.70.0030.00317.44
8.1.60.0030.00517.51
8.1.50.0040.00417.41
8.1.40.0000.00717.48
8.1.30.0040.00417.53
8.1.20.0000.00817.64
8.1.10.0040.00417.59
8.1.00.0070.00017.37
8.0.300.0050.00318.77
8.0.290.0070.00016.75
8.0.280.0000.00718.40
8.0.270.0000.00817.17
8.0.260.0030.00317.30
8.0.250.0030.00317.00
8.0.240.0030.00316.87
8.0.230.0070.00016.95
8.0.220.0000.00716.87
8.0.210.0030.00316.92
8.0.200.0070.00016.88
8.0.190.0040.00416.97
8.0.180.0070.00016.80
8.0.170.0030.00616.94
8.0.160.0070.00016.98
8.0.150.0070.00016.90
8.0.140.0040.00416.84
8.0.130.0000.00613.30
8.0.120.0000.00716.96
8.0.110.0000.00816.80
8.0.100.0000.00816.79
8.0.90.0070.00016.80
8.0.80.0120.00916.85
8.0.70.0050.00216.91
8.0.60.0000.00716.79
8.0.50.0080.00016.93
8.0.30.0090.01117.25
8.0.20.0060.01217.40
8.0.10.0040.00417.05
8.0.00.0100.01016.69
7.4.330.0030.00315.02
7.4.320.0040.00416.51
7.4.300.0000.00616.58
7.4.290.0000.00716.45
7.4.280.0040.00416.44
7.4.270.0000.00716.47
7.4.260.0070.00016.58
7.4.250.0000.00816.47
7.4.240.0000.00716.43
7.4.230.0020.00516.53
7.4.220.0070.01116.37
7.4.210.0070.00716.45
7.4.200.0040.00416.45
7.4.160.0080.00816.69
7.4.150.0070.01117.40
7.4.140.0090.01017.86
7.4.130.0060.01516.38
7.4.120.0090.00916.47
7.4.110.0060.01516.53
7.4.100.0070.01016.50
7.4.90.0070.01016.48
7.4.80.0040.01519.39
7.4.70.0100.00716.38
7.4.60.0000.01616.40
7.4.50.0030.00616.62
7.4.40.0070.01016.64
7.4.30.0080.00816.38
7.4.00.0000.01514.80
7.3.330.0000.00513.30
7.3.320.0020.00213.16
7.3.310.0000.00716.39
7.3.300.0000.00716.29
7.3.290.0080.00716.25
7.3.280.0100.00916.27
7.3.270.0150.00917.40
7.3.260.0100.00716.47
7.3.250.0070.01016.39
7.3.240.0140.00516.34
7.3.230.0140.00416.57
7.3.210.0080.00816.62
7.3.200.0030.01216.63
7.3.190.0120.00616.29
7.3.180.0070.01016.38
7.3.170.0150.00316.27
7.3.160.0110.00516.57
7.3.10.0160.00016.60
7.3.00.0060.00316.64
7.2.330.0130.00316.36
7.2.320.0100.00716.75
7.2.310.0100.00716.67
7.2.300.0080.00816.57
7.2.290.0090.01016.63
7.2.130.0080.00816.96
7.2.120.0100.01016.97
7.2.110.0160.00316.75
7.2.100.0070.01016.88
7.2.90.0070.00716.97
7.2.80.0030.01016.75
7.2.70.0160.00016.94
7.2.60.0070.00716.95
7.2.50.0050.00516.94
7.2.40.0030.00916.96
7.2.30.0080.00616.64
7.2.20.0090.00616.75
7.2.10.0100.00316.93
7.2.00.0100.00518.14
7.1.250.0060.00315.82
7.1.100.0060.00618.32
7.1.70.0000.00717.34
7.1.60.0090.01219.11
7.1.50.0100.01316.96
7.1.00.0030.07322.44
7.0.200.0000.00916.63
7.0.140.0030.07321.98
7.0.120.0030.07322.06
7.0.110.0030.07022.07
7.0.100.0030.07022.14
7.0.90.0070.07322.22
7.0.80.0030.06722.14
7.0.70.0030.05722.03
7.0.60.0000.07721.96
7.0.50.0100.07022.16
7.0.40.0000.07722.08
7.0.30.0070.07021.95
7.0.20.0000.07022.02
7.0.10.0070.06022.19
7.0.00.0030.07322.14
5.6.280.0070.09021.01
5.6.260.0030.07320.89
5.6.250.0000.07320.88
5.6.240.0030.07721.08
5.6.230.0070.07321.09
5.6.220.0030.07320.84
5.6.210.0000.07721.02
5.6.200.0070.07320.95
5.6.190.0030.07321.05
5.6.180.0030.07321.09
5.6.170.0030.07320.82
5.6.160.0100.06720.75
5.6.150.0000.08020.94
5.6.140.0100.07021.07
5.6.130.0030.07021.04
5.6.120.0000.07320.81
5.6.110.0030.07720.84
5.6.100.0030.07321.00
5.6.90.0000.07321.03
5.6.80.0070.06720.47
5.6.70.0030.07020.21
5.6.60.0030.07020.43
5.6.50.0030.07020.18
5.6.40.0000.07020.43
5.6.30.0070.07020.30
5.6.20.0030.07320.37
5.6.10.0100.06020.29
5.6.00.0100.06720.18
5.5.380.0030.07017.52
5.5.370.0000.07317.70
5.5.360.0000.07717.46
5.5.350.0030.07017.62
5.5.340.0070.07017.95
5.5.330.0030.07018.26
5.5.320.0030.07318.13
5.5.310.0030.07318.10
5.5.300.0030.07318.10
5.5.290.0030.05717.96
5.5.280.0030.07318.07
5.5.270.0100.06718.05
5.5.260.0000.07718.21
5.5.250.0000.07718.04
5.5.240.0070.06717.61
5.5.230.0000.07317.43
5.5.220.0030.05017.34
5.5.210.0030.06317.43
5.5.200.0000.06717.59
5.5.190.0000.06017.49
5.5.180.0030.06717.44
5.5.160.0000.07017.28
5.5.150.0030.07017.39
5.5.140.0030.06717.42
5.5.130.0030.06717.58
5.5.120.0000.07017.26
5.5.110.0070.06017.58
5.5.100.0070.06317.39
5.5.90.0030.05717.37
5.5.80.0000.06317.34
5.5.70.0070.06717.32
5.5.60.0000.07017.37
5.5.50.0000.07017.15
5.5.40.0000.07317.31
5.5.30.0070.06317.17
5.5.20.0000.07317.46
5.5.10.0030.07017.29
5.5.00.0030.05317.36
5.4.450.0000.06719.66
5.4.440.0000.06719.63
5.4.430.0070.06719.49
5.4.420.0030.07019.30
5.4.410.0030.05719.20
5.4.400.0030.06719.03
5.4.390.0070.06719.18
5.4.380.0070.06319.16
5.4.370.0030.06719.02
5.4.360.0000.06319.05
5.4.350.0030.06719.18
5.4.340.0070.06719.00
5.4.320.0030.07019.00
5.4.310.0000.07019.02
5.4.300.0030.06719.17
5.4.290.0030.06719.30
5.4.280.0070.06319.17
5.4.270.0030.05719.23
5.4.260.0030.06019.21
5.4.250.0030.06318.98
5.4.240.0000.05719.17
5.4.230.0000.07018.93
5.4.220.0000.06319.00
5.4.210.0030.06719.13
5.4.200.0000.05019.14
5.4.190.0000.07019.16
5.4.180.0000.07019.21
5.4.170.0070.05319.32
5.4.160.0030.07019.29
5.4.150.0000.07318.95
5.4.140.0000.06316.59
5.4.130.0030.06316.48
5.4.120.0000.06716.58
5.4.110.0070.06316.46
5.4.100.0070.05016.51
5.4.90.0000.06316.55
5.4.80.0030.05716.54
5.4.70.0030.06016.41
5.4.60.0100.05016.51
5.4.50.0000.06716.55
5.4.40.0000.06016.28
5.4.30.0000.05316.52
5.4.20.0030.04316.38
5.4.10.0000.05716.55
5.4.00.0000.05716.07
5.3.290.0070.06714.63
5.3.280.0030.06714.61
5.3.270.0000.07314.74
5.3.260.0000.07314.46
5.3.250.0030.06314.56
5.3.240.0000.06014.75
5.3.230.0030.06714.57
5.3.220.0000.06714.65
5.3.210.0070.06714.58
5.3.200.0030.06714.71
5.3.190.0070.05014.57
5.3.180.0000.05314.52
5.3.170.0030.06014.55
5.3.160.0000.05714.52
5.3.150.0000.06714.69
5.3.140.0100.06014.53
5.3.130.0030.05314.40
5.3.120.0000.05714.50
5.3.110.0030.05314.77
5.3.100.0030.06314.27
5.3.90.0000.06014.01
5.3.80.0000.06313.98
5.3.70.0070.06014.16
5.3.60.0000.06714.09
5.3.50.0070.05713.96
5.3.40.0000.06713.93
5.3.30.0070.06013.92
5.3.20.0000.06013.76
5.3.10.0000.06713.67
5.3.00.0030.06013.73
5.2.170.0030.05711.28
5.2.160.0000.04711.15
5.2.150.0000.05711.11
5.2.140.0000.05711.11
5.2.130.0000.05711.05
5.2.120.0000.05011.09
5.2.110.0030.05311.11
5.2.100.0070.05011.13
5.2.90.0030.05311.11
5.2.80.0070.04711.11
5.2.70.0070.05311.32
5.2.60.0030.05711.17
5.2.50.0030.05310.87
5.2.40.0030.05310.96
5.2.30.0030.05310.99
5.2.20.0030.05311.10
5.2.10.0030.05010.73
5.2.00.0030.05310.72
5.1.60.0000.0479.81
5.1.50.0030.0479.95
5.1.40.0070.03710.23
5.1.30.0000.05010.30
5.1.20.0070.04010.49
5.1.10.0030.0479.89
5.1.00.0000.05010.25
5.0.50.0000.0439.75
5.0.40.0000.0409.75
5.0.30.0000.0609.75
5.0.20.0070.0339.75
5.0.10.0030.0379.75
5.0.00.0070.0509.75
4.4.90.0000.0309.75
4.4.80.0030.0279.75
4.4.70.0030.0279.75
4.4.60.0000.0309.75
4.4.50.0000.0309.75
4.4.40.0030.0479.75
4.4.30.0000.0309.75
4.4.20.0070.0239.75
4.4.10.0000.0309.75
4.4.00.0000.0479.75
4.3.110.0030.0279.75
4.3.100.0000.0309.75
4.3.90.0000.0309.75
4.3.80.0030.0409.75
4.3.70.0030.0279.75
4.3.60.0000.0309.75
4.3.50.0070.0279.75
4.3.40.0000.0479.75
4.3.30.0000.0339.75
4.3.20.0000.0339.75
4.3.10.0070.0279.75
4.3.00.0000.0309.75

preferences:
41.33 ms | 401 KiB | 5 Q