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); }; echo $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.60.0040.01118.31
8.3.50.0090.00921.20
8.3.40.0120.00318.93
8.3.30.0120.00319.04
8.3.20.0050.00220.34
8.3.10.0080.00023.65
8.3.00.0090.00019.51
8.2.180.0070.01418.26
8.2.170.0070.00722.96
8.2.160.0090.00520.28
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00726.16
8.2.120.0080.00022.13
8.2.110.0040.00420.54
8.2.100.0070.00318.03
8.2.90.0040.00419.05
8.2.80.0060.00317.97
8.2.70.0040.00417.49
8.2.60.0050.00517.93
8.2.50.0000.00818.07
8.2.40.0030.00520.01
8.2.30.0040.00418.13
8.2.20.0080.00017.72
8.2.10.0090.00018.11
8.2.00.0000.00717.77
8.1.280.0140.01025.92
8.1.270.0050.00323.88
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0090.00023.75
8.1.230.0060.00618.97
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0000.00818.72
8.1.160.0040.00422.05
8.1.150.0040.00418.80
8.1.140.0000.00717.33
8.1.130.0000.00617.80
8.1.120.0080.00017.37
8.1.110.0080.00017.51
8.1.100.0040.00417.43
8.1.90.0040.00317.48
8.1.80.0000.00717.34
8.1.70.0030.00317.45
8.1.60.0060.00317.54
8.1.50.0040.00417.60
8.1.40.0040.00417.51
8.1.30.0040.00417.64
8.1.20.0000.00717.72
8.1.10.0030.00517.62
8.1.00.0050.00317.54
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0050.00218.48
8.0.270.0040.00417.16
8.0.260.0030.00317.20
8.0.250.0000.00716.98
8.0.240.0000.00817.00
8.0.230.0040.00416.88
8.0.220.0000.00716.79
8.0.210.0050.00216.88
8.0.200.0000.00716.95
8.0.190.0000.00716.90
8.0.180.0030.00316.81
8.0.170.0050.00216.81
8.0.160.0000.00716.91
8.0.150.0030.00416.84
8.0.140.0000.00716.89
8.0.130.0030.00313.25
8.0.120.0070.00016.73
8.0.110.0000.00716.85
8.0.100.0000.00716.75
8.0.90.0000.00716.68
8.0.80.0000.01516.85
8.0.70.0040.00416.79
8.0.60.0040.00416.86
8.0.50.0040.00416.80
8.0.30.0050.01417.26
8.0.20.0070.01317.40
8.0.10.0000.00716.90
8.0.00.0140.00816.93
7.4.330.0060.00015.14
7.4.320.0000.00616.46
7.4.300.0030.00316.61
7.4.290.0070.00016.41
7.4.280.0040.00416.47
7.4.270.0000.00716.46
7.4.260.0000.00816.63
7.4.250.0030.00516.36
7.4.240.0030.00516.57
7.4.230.0030.00316.60
7.4.220.0100.01016.56
7.4.210.0090.00616.55
7.4.200.0040.00416.41
7.4.160.0160.00616.55
7.4.150.0180.00017.40
7.4.140.0120.00917.86
7.4.130.0090.01416.54
7.4.120.0090.01116.49
7.4.110.0150.00416.29
7.4.100.0080.00816.47
7.4.90.0100.00716.43
7.4.80.0100.01119.39
7.4.70.0120.01216.64
7.4.60.0130.00916.53
7.4.50.0080.00016.36
7.4.40.0080.00816.69
7.4.30.0130.00516.58
7.4.00.0100.00715.09
7.3.330.0000.00613.22
7.3.320.0020.00213.29
7.3.310.0000.00716.29
7.3.300.0030.00316.20
7.3.290.0070.01016.31
7.3.280.0090.00616.31
7.3.270.0100.00917.40
7.3.260.0140.00316.30
7.3.250.0090.00816.57
7.3.240.0110.01116.46
7.3.230.0130.00416.50
7.3.210.0100.00716.31
7.3.200.0130.00316.67
7.3.190.0120.00416.35
7.3.180.0060.00916.31
7.3.170.0090.00816.40
7.3.160.0090.00916.43
7.2.330.0100.00716.50
7.2.320.0070.01016.58
7.2.310.0070.01016.60
7.2.300.0160.00016.79
7.2.290.0070.01016.73
7.1.70.0000.00717.14
7.1.60.0150.00619.11
7.1.50.0090.01616.85
7.1.00.0070.07022.33
7.0.200.0050.00516.72
7.0.140.0000.08022.08
7.0.60.0000.08719.96
7.0.50.0070.04017.96
7.0.40.0070.04020.41
7.0.30.0370.06020.33
7.0.20.0370.03720.23
7.0.10.0170.04320.19
7.0.00.0100.08320.15
5.6.280.0000.07721.07
5.6.210.0100.06720.73
5.6.200.0100.06018.18
5.6.190.0030.04320.79
5.6.180.3170.04020.77
5.6.170.0430.06320.47
5.6.160.0170.06020.50
5.6.150.0030.05018.19
5.6.140.0070.06718.21
5.6.130.0030.04018.19
5.6.120.0130.07321.00
5.6.110.0070.08321.02
5.6.100.0100.06721.03
5.6.90.0000.05020.93
5.6.80.0030.04720.52
5.6.70.3630.03720.39
5.5.350.0300.07320.48
5.5.340.0130.07317.97
5.5.330.0170.07320.25
5.5.320.0270.06320.34
5.5.310.0200.04020.36
5.5.300.0100.05317.93
5.5.290.0030.08317.98
5.5.280.0030.07320.80
5.5.270.0130.07020.79
5.5.260.0030.07720.83
5.5.250.0170.06320.79
5.5.240.0030.05020.36
5.4.450.1200.04319.20
5.4.440.0600.07319.42
5.4.430.0530.05319.48
5.4.420.0670.00019.54
5.4.410.0630.00019.25
5.4.400.0630.00019.18
5.4.390.0670.00019.02
5.4.380.0630.00019.13
5.4.370.0630.00018.98
5.4.360.0600.00019.04
5.4.350.0630.00019.09
5.4.340.0060.03412.02
5.4.320.0060.03612.51
5.4.310.0050.03712.50
5.4.300.0100.03612.51
5.4.290.0040.03912.50
5.4.280.0040.04012.40
5.4.270.0060.04012.40
5.4.260.0070.04012.40
5.4.250.0070.03912.40
5.4.240.0080.03612.40
5.4.230.0040.04012.39
5.4.220.0060.03812.39
5.4.210.0070.04012.40
5.4.200.0080.03812.39
5.4.190.0070.03412.39
5.4.180.0090.03612.39
5.4.170.0060.03512.40
5.4.160.0050.03712.40
5.4.150.0040.03812.39
5.4.140.0050.04712.07
5.4.130.0030.03812.06
5.4.120.0030.04012.02
5.4.110.0040.03612.02
5.4.100.0120.03612.02
5.4.90.0060.03812.02
5.4.80.0110.03212.02
5.4.70.0050.03512.01
5.4.60.0070.03412.01
5.4.50.0060.03412.02
5.4.40.0060.03412.00
5.4.30.0060.03512.00
5.4.20.0110.04111.99
5.4.10.0060.04412.00
5.4.00.0060.04011.48
5.3.290.0080.03812.80
5.3.280.0110.03612.71
5.3.270.0060.04112.73
5.3.260.0030.04112.72
5.3.250.0060.03712.72
5.3.240.0090.03612.72
5.3.230.0070.03812.71
5.3.220.0090.03212.68
5.3.210.0050.04012.68
5.3.200.0090.03512.68
5.3.190.0060.03812.68
5.3.180.0080.03712.68
5.3.170.0050.03512.67
5.3.160.0080.03312.68
5.3.150.0050.03812.68
5.3.140.0030.03812.66
5.3.130.0050.03912.66
5.3.120.0140.03012.66
5.3.110.0100.03312.66
5.3.100.0040.03812.12
5.3.90.0040.03712.12
5.3.80.0040.03712.10
5.3.70.0050.04812.10
5.3.60.0070.04212.08
5.3.50.0050.03812.04
5.3.40.0050.03712.04
5.3.30.0060.03411.99
5.3.20.0040.03711.77
5.3.10.0030.03711.73
5.3.00.0080.03311.73
5.2.170.0040.0309.21
5.2.160.0090.0259.21
5.2.150.0060.0289.21
5.2.140.0040.0309.21
5.2.130.0040.0299.17
5.2.120.0050.0289.18
5.2.110.0030.0309.18
5.2.100.0060.0309.18
5.2.90.0030.0309.18
5.2.80.0030.0319.18
5.2.70.0080.0279.18
5.2.60.0050.0299.13
5.2.50.0030.0309.09
5.2.40.0070.0279.07
5.2.30.0060.0339.05
5.2.20.0030.0399.04
5.2.10.0040.0288.95
5.2.00.0090.0318.80
5.1.60.0010.0288.09
5.1.50.0050.0238.09
5.1.40.0050.0248.07
5.1.30.0050.0258.42
5.1.20.0030.0288.44
5.1.10.0070.0298.16
5.1.00.0060.0278.16
5.0.50.0030.0256.64
5.0.40.0070.0226.50
5.0.30.0070.0306.31
5.0.20.0050.0246.28
5.0.10.0020.0206.26
5.0.00.0010.0316.25
4.4.90.0020.0154.78
4.4.80.0040.0134.76
4.4.70.0040.0144.76
4.4.60.0000.0214.75
4.4.50.0030.0154.77
4.4.40.0020.0364.71
4.4.30.0020.0164.76
4.4.20.0040.0144.84
4.4.10.0040.0144.85
4.4.00.0020.0254.76
4.3.110.0020.0164.67
4.3.100.0030.0184.67
4.3.90.0020.0164.64
4.3.80.0030.0254.58
4.3.70.0030.0134.63
4.3.60.0030.0164.63
4.3.50.0030.0144.63
4.3.40.0040.0224.54
4.3.30.0020.0153.30
4.3.20.0020.0163.27
4.3.10.0050.0203.24
4.3.00.0000.02012.36

preferences:
36.23 ms | 401 KiB | 5 Q