3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zero = 0; // global scope $f1 = function() use ($zero) { $one = 1; // third-level closure scope of f4 echo $one; $f2 = function() use ($zero, $one) { $two = 2; // second-level closure scope of f4 echo $one + $two; $f3 = function() use ($zero, $one, $two) { $three = 3; // first-level closure scope of f4 $f4 = function() use ($zero, $one, $two, $three) { $four = 4; // local scope of f4 var_dump($zero + $one + $two + $three + $four); }; $f4(); }; }; $f2(); }; $f1(); $f2();

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.0110.00318.55
8.3.50.0100.00621.08
8.3.40.0190.00018.79
8.3.30.0070.00719.07
8.3.20.0080.00020.33
8.3.10.0080.00023.53
8.3.00.0040.00419.25
8.2.180.0110.00416.88
8.2.170.0060.00922.96
8.2.160.0110.00320.44
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00019.83
8.2.110.0030.00620.32
8.2.100.0070.00418.03
8.2.90.0000.00719.05
8.2.80.0040.00417.97
8.2.70.0040.00417.60
8.2.60.0000.00818.04
8.2.50.0000.00818.07
8.2.40.0080.00019.75
8.2.30.0040.00418.13
8.2.20.0040.00417.86
8.2.10.0040.00418.00
8.2.00.0030.00617.75
8.1.280.0150.00625.92
8.1.270.0110.00822.14
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0040.00423.91
8.1.230.0070.00419.01
8.1.220.0040.00417.74
8.1.210.0050.00518.77
8.1.200.0060.00317.25
8.1.190.0080.00017.35
8.1.180.0060.00318.10
8.1.170.0080.00018.72
8.1.160.0040.00422.03
8.1.150.0030.00318.89
8.1.140.0040.00417.37
8.1.130.0030.00317.81
8.1.120.0000.00717.52
8.1.110.0000.00917.36
8.1.100.0040.00417.46
8.1.90.0030.00617.36
8.1.80.0050.00317.48
8.1.70.0000.00717.45
8.1.60.0030.00517.48
8.1.50.0050.00317.43
8.1.40.0040.00417.52
8.1.30.0040.00417.66
8.1.20.0030.00617.55
8.1.10.0030.00517.57
8.1.00.0080.00017.41
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0050.00318.52
8.0.270.0070.00017.25
8.0.260.0080.00017.26
8.0.250.0000.00717.04
8.0.240.0000.00616.94
8.0.230.0000.00716.90
8.0.220.0000.00816.86
8.0.210.0050.00216.98
8.0.200.0000.00716.96
8.0.190.0040.00416.98
8.0.180.0030.00317.02
8.0.170.0090.00016.96
8.0.160.0040.00316.99
8.0.150.0070.00016.89
8.0.140.0030.00516.98
8.0.130.0000.00713.33
8.0.120.0070.00016.92
8.0.110.0040.00416.87
8.0.100.0000.00716.99
8.0.90.0000.00716.87
8.0.80.0090.00616.93
8.0.70.0040.00416.78
8.0.60.0000.00716.86
8.0.50.0000.00816.96
8.0.30.0080.01117.08
8.0.20.0170.00217.40
8.0.10.0030.00616.91
8.0.00.0070.01116.74
7.4.330.0000.00515.02
7.4.320.0000.00616.53
7.4.300.0000.00616.57
7.4.290.0000.00716.61
7.4.280.0050.00516.49
7.4.270.0030.00516.60
7.4.260.0000.00816.40
7.4.250.0000.00816.42
7.4.240.0000.00816.55
7.4.230.0030.00316.48
7.4.220.0070.01116.69
7.4.210.0160.00916.52
7.4.200.0000.00716.51
7.4.160.0060.01116.81
7.4.150.0000.02117.40
7.4.140.0020.01717.86
7.4.130.0100.00716.58
7.4.120.0070.01016.63
7.4.110.0060.01316.50
7.4.100.0030.01316.57
7.4.90.0140.00316.55
7.4.80.0080.00819.39
7.4.70.0080.00816.55
7.4.60.0070.01016.52
7.4.50.0090.00016.64
7.4.40.0060.01016.57
7.4.30.0060.01216.65
7.4.00.0030.01315.01
7.3.330.0030.00313.42
7.3.320.0030.00213.30
7.3.310.0000.00716.19
7.3.300.0060.00016.39
7.3.290.0070.00916.34
7.3.280.0070.01116.42
7.3.270.0120.01217.40
7.3.260.0110.00716.42
7.3.250.0130.00716.56
7.3.240.0040.01716.55
7.3.230.0110.00616.39
7.3.210.0130.00316.46
7.3.200.0160.00619.39
7.3.190.0100.01316.32
7.3.180.0060.00916.45
7.3.170.0080.00816.52
7.3.160.0070.01316.59
7.2.330.0140.01016.53
7.2.320.0070.01016.41
7.2.310.0070.01016.87
7.2.300.0060.01016.63
7.2.290.0110.01116.59
7.2.60.0130.00316.81
7.2.00.0040.00819.00
7.1.200.0030.00315.78
7.1.100.0110.00017.84
7.1.70.0130.00017.15
7.1.60.0060.01919.11
7.1.50.0140.02034.82
7.1.00.0030.07722.49
7.0.200.0000.00916.73
7.0.140.0100.07022.07
7.0.60.0100.07319.96
7.0.50.0100.04317.86
7.0.40.0100.08320.02
7.0.30.0270.07320.33
7.0.20.0230.08020.20
7.0.10.0030.04320.24
7.0.00.0030.04320.14
5.6.210.0000.05320.52
5.6.200.0070.06318.14
5.6.190.0030.05320.47
5.6.180.0230.08320.68
5.6.170.0130.04720.59
5.6.160.0030.04020.54
5.6.150.0130.07718.18
5.6.140.0130.07318.29
5.6.130.0130.07318.16
5.6.120.0130.06721.15
5.6.110.0070.08321.13
5.6.100.0170.06321.03
5.6.90.0100.08021.05
5.6.80.0100.08020.40
5.5.350.4200.04020.46
5.5.340.0000.04017.99
5.5.330.0070.03720.42
5.5.320.0230.08020.14
5.5.310.0270.06320.32
5.5.300.0100.05317.95
5.5.290.0030.04718.07
5.5.280.0070.07720.77
5.5.270.0070.05720.89
5.5.260.0170.05320.74
5.5.250.0000.08720.79
5.5.240.0100.07320.09
5.4.450.0600.06019.17
5.4.440.0870.05319.17
5.4.430.0800.06319.55
5.4.420.0700.00019.53
5.4.410.0630.00019.25
5.4.400.0630.00019.33
5.4.390.0730.00019.21
5.4.380.0630.00019.07
5.4.370.0630.00018.98
5.4.360.0630.00019.06
5.4.350.0630.00019.16
5.4.340.0030.04112.03
5.4.320.0080.04412.52
5.4.310.0060.04212.52
5.4.300.0080.03512.52
5.4.290.0050.04012.52
5.4.280.0060.03412.42
5.4.270.0060.03612.41
5.4.260.0050.03712.41
5.4.250.0080.03412.41
5.4.240.0050.03712.41
5.4.230.0050.04112.41
5.4.220.0080.03612.40
5.4.210.0050.03512.41
5.4.200.0080.04012.41
5.4.190.0060.03812.41
5.4.180.0090.03112.41
5.4.170.0070.03912.41
5.4.160.0030.03712.41
5.4.150.0060.03412.40
5.4.140.0090.03912.08
5.4.130.0050.04512.08
5.4.120.0080.03212.04
5.4.110.0040.03612.03
5.4.100.0050.03612.02
5.4.90.0060.03612.02
5.4.80.0060.03612.02
5.4.70.0050.03912.02
5.4.60.0050.03512.02
5.4.50.0070.03312.03
5.4.40.0050.03412.01
5.4.30.0100.03812.01
5.4.20.0110.02912.01
5.4.10.0020.03612.01
5.4.00.0060.03511.50
5.3.290.0090.03712.80
5.3.280.0050.03712.71
5.3.270.0070.05412.72
5.3.260.0050.03912.72
5.3.250.0070.03512.72
5.3.240.0090.03612.72
5.3.230.0100.04212.71
5.3.220.0050.03712.68
5.3.210.0080.04412.68
5.3.200.0060.03812.68
5.3.190.0050.04112.68
5.3.180.0090.03212.67
5.3.170.0080.03312.68
5.3.160.0050.04412.68
5.3.150.0070.03712.67
5.3.140.0040.03712.66
5.3.130.0090.04212.66
5.3.120.0080.03612.66
5.3.110.0100.04212.66
5.3.100.0040.03712.14
5.3.90.0040.03612.12
5.3.80.0080.03312.12
5.3.70.0110.03312.12
5.3.60.0090.03512.10
5.3.50.0080.03612.04
5.3.40.0050.03712.05
5.3.30.0060.04312.01
5.3.20.0080.03411.79
5.3.10.0080.03111.76
5.3.00.0080.04011.74
5.2.170.0070.0289.18
5.2.160.0040.0369.18
5.2.150.0060.0319.18
5.2.140.0020.0339.18
5.2.130.0050.0289.14
5.2.120.0040.0289.14
5.2.110.0070.0299.14
5.2.100.0050.0319.14
5.2.90.0040.0319.14
5.2.80.0050.0309.14
5.2.70.0050.0309.14
5.2.60.0050.0329.09
5.2.50.0080.0309.06
5.2.40.0010.0339.03
5.2.30.0060.0359.01
5.2.20.0050.0289.00
5.2.10.0040.0328.93
5.2.00.0070.0318.78
5.1.60.0040.0298.07
5.1.50.0040.0318.07
5.1.40.0060.0218.05
5.1.30.0040.0278.40
5.1.20.0010.0308.41
5.1.10.0060.0278.14
5.1.00.0070.0248.14
5.0.50.0030.0206.62
5.0.40.0070.0296.48
5.0.30.0040.0326.29
5.0.20.0040.0186.27
5.0.10.0010.0226.24
5.0.00.0030.0366.23
4.4.90.0030.0164.78
4.4.80.0060.0134.75
4.4.70.0030.0194.75
4.4.60.0020.0174.76
4.4.50.0000.0184.77
4.4.40.0040.0244.71
4.4.30.0050.0164.76
4.4.20.0050.0164.85
4.4.10.0010.0184.85
4.4.00.0020.0254.76
4.3.110.0000.0254.67
4.3.100.0050.0174.66
4.3.90.0030.0154.64
4.3.80.0010.0314.58
4.3.70.0030.0144.63
4.3.60.0040.0134.63
4.3.50.0020.0174.63
4.3.40.0030.0244.53
4.3.30.0030.0163.28
4.3.20.0040.0153.26
4.3.10.0020.0163.22
4.3.00.0100.0207.28

preferences:
49.84 ms | 401 KiB | 5 Q