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 echo $zero + $one + $two + $three; $f4 = function() use ($zero, $one, $two, $three) { $four = 4; // local scope of f4 var_dump($zero + $one + $two + $three + $four); }; $f4(); }; $f3(); }; $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.0150.00018.68
8.3.50.0120.00721.09
8.3.40.0120.00918.74
8.3.30.0000.01419.09
8.3.20.0040.00420.21
8.3.10.0040.00423.52
8.3.00.0050.00319.26
8.2.180.0030.01116.63
8.2.170.0080.00822.96
8.2.160.0070.01020.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00322.24
8.2.110.0030.00720.57
8.2.100.0030.00718.09
8.2.90.0040.00418.99
8.2.80.0040.00417.97
8.2.70.0030.00617.49
8.2.60.0030.00618.04
8.2.50.0040.00418.07
8.2.40.0000.00819.88
8.2.30.0040.00418.05
8.2.20.0040.00417.75
8.2.10.0070.00018.14
8.2.00.0070.00017.73
8.1.280.0140.00325.92
8.1.270.0060.01322.01
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0090.00023.91
8.1.230.0110.00019.04
8.1.220.0050.00317.91
8.1.210.0030.00518.77
8.1.200.0060.00317.13
8.1.190.0030.00517.36
8.1.180.0060.00318.10
8.1.170.0040.00418.59
8.1.160.0000.00822.01
8.1.150.0080.00018.81
8.1.140.0000.00717.36
8.1.130.0030.00317.88
8.1.120.0000.00817.37
8.1.110.0000.00817.47
8.1.100.0000.00717.40
8.1.90.0030.00617.35
8.1.80.0070.00017.47
8.1.70.0000.00717.36
8.1.60.0040.00417.49
8.1.50.0040.00417.43
8.1.40.0070.00017.43
8.1.30.0000.00917.53
8.1.20.0000.00917.51
8.1.10.0000.00817.45
8.1.00.0000.00817.53
8.0.300.0020.00518.77
8.0.290.0020.00516.75
8.0.280.0050.00218.36
8.0.270.0000.00817.27
8.0.260.0030.00317.26
8.0.250.0070.00017.08
8.0.240.0000.00717.07
8.0.230.0000.00717.04
8.0.220.0000.00816.82
8.0.210.0030.00316.85
8.0.200.0000.00716.93
8.0.190.0040.00417.09
8.0.180.0030.00516.87
8.0.170.0000.00916.96
8.0.160.0000.00717.01
8.0.150.0080.00016.87
8.0.140.0040.00416.91
8.0.130.0050.00313.34
8.0.120.0000.00816.92
8.0.110.0070.00016.98
8.0.100.0040.00416.94
8.0.90.0000.00716.96
8.0.80.0060.00916.99
8.0.70.0020.00517.00
8.0.60.0070.00016.83
8.0.50.0040.00416.89
8.0.30.0110.01017.27
8.0.20.0120.00817.40
8.0.10.0060.00317.14
8.0.00.0120.00916.77
7.4.330.0050.00015.02
7.4.320.0030.00316.54
7.4.300.0000.00616.51
7.4.290.0040.00416.62
7.4.280.0120.00016.59
7.4.270.0040.00416.54
7.4.260.0080.00016.48
7.4.250.0050.00316.56
7.4.240.0080.00016.55
7.4.230.0040.00416.56
7.4.220.0040.01516.61
7.4.210.0000.01816.59
7.4.200.0020.00516.54
7.4.160.0110.00716.65
7.4.150.0030.02117.40
7.4.140.0070.01217.86
7.4.130.0070.01016.41
7.4.120.0090.00816.41
7.4.110.0140.00416.63
7.4.100.0100.00716.52
7.4.90.0170.00716.54
7.4.80.0120.00919.39
7.4.70.0090.00916.59
7.4.60.0040.01216.51
7.4.50.0050.00316.61
7.4.40.0110.00616.50
7.4.30.0060.01016.57
7.4.00.0070.00714.71
7.3.330.0030.00313.36
7.3.320.0060.00013.36
7.3.310.0000.00816.27
7.3.300.0030.00316.38
7.3.290.0080.01016.33
7.3.280.0120.00716.37
7.3.270.0150.00917.40
7.3.260.0130.00416.61
7.3.250.0060.01416.57
7.3.240.0070.01016.47
7.3.230.0100.00716.39
7.3.210.0060.01016.69
7.3.200.0070.01419.39
7.3.190.0100.00716.41
7.3.180.0170.00016.37
7.3.170.0070.01416.52
7.3.160.0030.01516.66
7.2.330.0120.00616.63
7.2.320.0080.00816.79
7.2.310.0090.00916.60
7.2.300.0100.00716.63
7.2.290.0090.00916.67
7.2.60.0100.00616.35
7.2.00.0000.01419.30
7.1.200.0090.00315.52
7.1.100.0060.00617.87
7.1.70.0100.01617.15
7.1.60.0110.01519.11
7.1.50.0240.01434.83
7.1.00.0100.07022.44
7.0.200.0040.00416.60
7.0.140.0030.07322.18
7.0.60.0070.04019.94
7.0.50.0030.04017.79
7.0.40.0100.07720.13
7.0.30.0170.04320.26
7.0.20.0300.08020.06
7.0.10.0030.08020.13
7.0.00.0130.08020.16
5.6.280.0000.07721.01
5.6.210.0130.07320.76
5.6.200.0030.04318.27
5.6.190.0100.05320.62
5.6.180.0230.08320.61
5.6.170.0330.07720.62
5.6.160.0100.07320.61
5.6.150.0070.04718.25
5.6.140.0070.08018.23
5.6.130.0030.05318.25
5.6.120.0100.07321.01
5.6.110.0030.04021.14
5.6.100.0000.07320.91
5.6.90.0170.07721.02
5.6.80.0030.05720.53
5.6.70.4570.03320.40
5.5.350.0070.07020.36
5.5.340.0100.08017.99
5.5.330.0030.05020.47
5.5.320.0230.04320.31
5.5.310.0330.07020.32
5.5.300.0070.08017.99
5.5.290.0030.08317.99
5.5.280.0070.03720.87
5.5.270.0030.06020.98
5.5.260.0070.08320.78
5.5.250.0070.07720.80
5.5.240.0230.08020.10
5.4.450.0930.04719.60
5.4.440.0630.06719.59
5.4.430.0330.05719.57
5.4.420.0670.00019.39
5.4.410.0630.00019.21
5.4.400.0630.00019.23
5.4.390.0630.00019.13
5.4.380.0830.00019.12
5.4.370.0630.00019.02
5.4.360.0600.00019.09
5.4.350.0670.00019.26
5.4.340.0050.03712.03
5.4.320.0080.04212.52
5.4.310.0080.04112.52
5.4.300.0050.04612.52
5.4.290.0060.03712.52
5.4.280.0070.04112.41
5.4.270.0090.03812.41
5.4.260.0090.03812.41
5.4.250.0040.03812.41
5.4.240.0050.04212.41
5.4.230.0050.03812.41
5.4.220.0080.03912.41
5.4.210.0040.04012.41
5.4.200.0020.04212.41
5.4.190.0050.03712.40
5.4.180.0060.03612.40
5.4.170.0050.03812.41
5.4.160.0040.03812.40
5.4.150.0060.04012.40
5.4.140.0070.04012.09
5.4.130.0100.03112.07
5.4.120.0050.03512.03
5.4.110.0070.03412.03
5.4.100.0090.03512.03
5.4.90.0060.03512.03
5.4.80.0060.03612.02
5.4.70.0060.03712.02
5.4.60.0060.04412.03
5.4.50.0040.03612.02
5.4.40.0040.03512.02
5.4.30.0070.04012.01
5.4.20.0040.04212.01
5.4.10.0090.03812.01
5.4.00.0060.03711.50
5.3.290.0050.04012.80
5.3.280.0090.03512.71
5.3.270.0090.04212.72
5.3.260.0050.04112.72
5.3.250.0140.03612.72
5.3.240.0090.04012.72
5.3.230.0090.03312.71
5.3.220.0080.03412.68
5.3.210.0070.03712.68
5.3.200.0050.03612.68
5.3.190.0060.03912.69
5.3.180.0060.03812.68
5.3.170.0060.03512.68
5.3.160.0130.03412.68
5.3.150.0050.03712.68
5.3.140.0060.03612.67
5.3.130.0050.04112.67
5.3.120.0050.04012.67
5.3.110.0090.03612.66
5.3.100.0050.03712.14
5.3.90.0070.03412.13
5.3.80.0040.03712.12
5.3.70.0070.03512.12
5.3.60.0040.03712.10
5.3.50.0070.03412.04
5.3.40.0060.03512.04
5.3.30.0080.03312.01
5.3.20.0030.03811.79
5.3.10.0080.03811.76
5.3.00.0080.03611.74
5.2.170.0070.0279.18
5.2.160.0060.0329.18
5.2.150.0070.0379.18
5.2.140.0050.0309.18
5.2.130.0030.0309.14
5.2.120.0060.0349.14
5.2.110.0030.0319.14
5.2.100.0060.0279.14
5.2.90.0050.0279.14
5.2.80.0070.0279.14
5.2.70.0050.0319.14
5.2.60.0060.0299.09
5.2.50.0030.0319.06
5.2.40.0050.0289.04
5.2.30.0040.0309.02
5.2.20.0060.0299.00
5.2.10.0040.0288.93
5.2.00.0040.0298.79
5.1.60.0080.0218.06
5.1.50.0070.0218.06
5.1.40.0060.0228.04
5.1.30.0090.0218.40
5.1.20.0030.0298.41
5.1.10.0060.0248.14
5.1.00.0030.0268.14
5.0.50.0050.0216.62
5.0.40.0050.0236.48
5.0.30.0020.0336.29
5.0.20.0020.0216.26
5.0.10.0020.0266.24
5.0.00.0050.0326.24
4.4.90.0040.0134.78
4.4.80.0020.0154.75
4.4.70.0020.0164.75
4.4.60.0040.0144.76
4.4.50.0040.0134.77
4.4.40.0030.0244.71
4.4.30.0050.0124.76
4.4.20.0040.0144.84
4.4.10.0020.0154.84
4.4.00.0020.0254.76
4.3.110.0030.0164.67
4.3.100.0020.0154.66
4.3.90.0010.0154.64
4.3.80.0040.0234.58
4.3.70.0030.0144.63
4.3.60.0000.0164.63
4.3.50.0030.0144.63
4.3.40.0030.0234.54
4.3.30.0000.0173.28
4.3.20.0020.0153.26
4.3.10.0040.0133.22
4.3.00.0200.0207.28

preferences:
39.43 ms | 401 KiB | 5 Q