3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function bar() { return function () { return function () { }; }; } } $f = new foo(); $closure = $f->bar(); $reflection1 = new ReflectionFunction($closure); $reflection2 = new ReflectionFunction($closure()); var_dump($reflection1->getClosureScopeClass()->name); var_dump($reflection2->getClosureScopeClass()->name);

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.0070.00718.81
8.3.30.0160.00318.96
8.3.20.0070.00020.38
8.3.10.0030.00523.61
8.3.00.0090.00019.68
8.2.170.0100.00722.96
8.2.160.0140.00020.34
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.15
8.2.110.0070.00322.30
8.2.100.0120.00317.72
8.2.90.0030.00619.05
8.2.80.0090.00017.97
8.2.70.0040.00417.36
8.2.60.0000.01017.93
8.2.50.0100.00018.07
8.2.40.0080.00018.14
8.2.30.0060.00618.16
8.2.20.0040.00417.75
8.2.10.0050.00319.76
8.2.00.0030.00517.57
8.1.270.0040.00423.82
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.93
8.1.230.0070.00419.05
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0070.00317.23
8.1.190.0000.00817.10
8.1.180.0080.00018.10
8.1.170.0030.00518.52
8.1.160.0090.00022.11
8.1.150.0070.00018.87
8.1.140.0000.00717.47
8.1.130.0000.00717.89
8.1.120.0030.00317.50
8.1.110.0000.00817.45
8.1.100.0040.00417.42
8.1.90.0000.00817.51
8.1.80.0030.00617.37
8.1.70.0070.00017.45
8.1.60.0060.00317.47
8.1.50.0040.00417.54
8.1.40.0040.00417.53
8.1.30.0000.00817.54
8.1.20.0040.00417.67
8.1.10.0080.00017.55
8.1.00.0040.00417.50
8.0.300.0070.00018.77
8.0.290.0000.00816.60
8.0.280.0030.00318.30
8.0.270.0000.00817.20
8.0.260.0030.00317.19
8.0.250.0040.00416.78
8.0.240.0040.00416.72
8.0.230.0030.00316.89
8.0.220.0030.00616.72
8.0.210.0060.00316.84
8.0.200.0030.00316.84
8.0.190.0050.00316.82
8.0.180.0040.00416.87
8.0.170.0030.00616.93
8.0.160.0030.00516.94
8.0.150.0000.00716.70
8.0.140.0050.00316.75
8.0.130.0030.00313.30
8.0.120.0050.00316.88
8.0.110.0050.00216.78
8.0.100.0040.00416.77
8.0.90.0000.00716.76
8.0.80.0100.00716.86
8.0.70.0040.00416.84
8.0.60.0000.00816.95
8.0.50.0050.00316.90
8.0.30.0120.00616.82
8.0.20.0130.00517.40
8.0.10.0030.00516.90
8.0.00.0110.01016.63
7.4.330.0000.00515.01
7.4.320.0060.00016.60
7.4.300.0060.00016.58
7.4.290.0030.00316.59
7.4.280.0030.00616.54
7.4.270.0070.00016.53
7.4.260.0100.00016.45
7.4.250.0030.00316.57
7.4.240.0000.00716.59
7.4.230.0030.00316.60
7.4.220.0060.01316.63
7.4.210.0140.00016.47
7.4.200.0000.00716.40
7.4.160.0040.01116.60
7.4.150.0090.01017.40
7.4.140.0130.00517.86
7.4.130.0110.00616.57
7.4.120.0070.00916.57
7.4.110.0130.01016.52
7.4.100.0200.00316.62
7.4.90.0090.01916.41
7.4.80.0100.00719.39
7.4.70.0030.01316.50
7.4.60.0060.01016.50
7.4.50.0000.00616.70
7.4.40.0100.00616.68
7.4.30.0130.00316.57
7.4.00.0040.00914.98
7.3.330.0020.00213.30
7.3.320.0000.00613.11
7.3.310.0040.00416.32
7.3.300.0070.00016.21
7.3.290.0040.01116.31
7.3.280.0110.00616.27
7.3.270.0100.00717.40
7.3.260.0160.00316.57
7.3.250.0080.01116.25
7.3.240.0090.00916.53
7.3.230.0070.01416.59
7.3.210.0070.01016.47
7.3.200.0090.01519.39
7.3.190.0070.01016.44
7.3.180.0130.00316.46
7.3.170.0120.00416.31
7.3.160.0120.00316.24
7.3.120.0070.00914.72
7.3.110.0090.00914.82
7.3.100.0030.00615.02
7.3.90.0100.00314.77
7.3.80.0030.01214.71
7.3.70.0100.00714.63
7.3.60.0030.00614.45
7.3.50.0000.01214.71
7.3.40.0060.00914.72
7.3.30.0100.00614.88
7.3.20.0030.01016.34
7.3.10.0030.01016.44
7.3.00.0070.00816.55
7.2.330.0030.01316.77
7.2.320.0030.02116.39
7.2.310.0030.01316.80
7.2.300.0000.01616.38
7.2.290.0040.01216.41
7.2.250.0110.00715.30
7.2.240.0100.01015.01
7.2.230.0110.00414.44
7.2.220.0090.00614.79
7.2.210.0000.01215.11
7.2.200.0100.00014.98
7.2.190.0080.00414.89
7.2.180.0090.00614.69
7.2.170.0040.00815.04
7.2.130.0030.00916.90
7.2.120.0030.01017.04
7.2.110.0070.00716.73
7.2.100.0060.00616.71
7.2.90.0030.01016.87
7.2.80.0040.00816.89
7.2.70.0080.00316.66
7.2.60.0030.01017.04
7.2.50.0060.00316.95
7.2.40.0040.01116.52
7.2.30.0030.00617.11
7.2.20.0070.00716.70
7.2.10.0000.01317.14
7.2.00.0030.01217.13
7.1.330.0000.01515.82
7.1.320.0030.00815.51
7.1.310.0000.00915.75
7.1.300.0030.00915.83
7.1.290.0030.00615.93
7.1.280.0060.01015.77
7.1.270.0040.00715.79
7.1.260.0000.01515.71
7.1.250.0100.00315.57
7.1.200.0030.01015.84
7.1.70.0170.00416.85
7.1.60.0000.01319.70
7.1.50.0040.02116.91
7.1.00.0070.07322.36
7.0.200.0040.00416.69
7.0.140.0070.06722.11
7.0.60.0200.07019.98
7.0.50.0100.04717.75
7.0.40.0070.08720.13
7.0.30.0530.07020.09
7.0.20.0270.04020.32
7.0.10.0300.07720.12
7.0.00.0170.03020.06
5.6.280.0070.07021.13
5.6.210.0000.04020.67
5.6.200.0070.07718.16
5.6.190.0030.04320.67
5.6.180.0330.04020.59
5.6.170.0270.03020.54
5.6.160.0030.05320.46
5.6.150.0030.05718.28
5.6.140.0130.07018.19
5.6.130.0070.08018.19
5.6.120.0070.04721.13
5.6.110.0070.07721.02
5.6.100.0170.08021.12
5.6.90.0070.08720.99
5.6.80.0070.08320.42
5.5.350.0230.07320.32
5.5.340.0070.04017.93
5.5.330.0200.06720.40
5.5.320.0070.08020.48
5.5.310.0270.08320.25
5.5.300.0070.04717.97
5.5.290.0030.06317.98
5.5.280.0100.08020.80
5.5.270.0070.08720.73
5.5.260.0030.04020.77
5.5.250.0100.03720.48
5.5.240.0130.07020.04
5.4.450.0800.05719.55
5.4.440.0930.05019.61
5.4.430.1400.06719.52
5.4.420.0700.00019.42
5.4.410.0070.06018.86
5.4.400.0230.04318.77
5.4.390.0130.06018.80
5.4.380.0230.06018.52
5.4.370.0100.05018.78
5.4.360.0070.04318.73
5.4.350.0070.03312.03
5.4.340.0100.03212.03
5.4.320.0090.03512.52
5.4.310.0040.03912.51
5.4.300.0050.04812.51
5.4.290.0080.04212.51
5.4.280.0110.03912.41
5.4.270.0070.04312.41
5.4.260.0110.04112.41
5.4.250.0080.04712.41
5.4.240.0050.03912.41
5.4.230.0050.04012.40
5.4.220.0050.04012.40
5.4.210.0140.03412.40
5.4.200.0070.04112.39
5.4.190.0060.03912.39
5.4.180.0070.03812.40
5.4.170.0100.04012.41
5.4.160.0050.04612.40
5.4.150.0090.04012.39
5.4.140.0050.03812.08
5.4.130.0040.03712.07
5.4.120.0060.03512.02
5.4.110.0070.03312.02
5.4.100.0080.04112.02
5.4.90.0060.04712.02
5.4.80.0050.04012.02
5.4.70.0090.03612.02
5.4.60.0070.04712.02
5.4.50.0050.03712.02
5.4.40.0090.04312.00
5.4.30.0090.03912.00
5.4.20.0050.03412.00
5.4.10.0080.03912.00
5.4.00.0050.03511.49
5.3.290.0080.04512.80
5.3.280.0070.04212.71
5.3.270.0070.04012.72
5.3.260.0040.04012.72
5.3.250.0120.04312.72
5.3.240.0120.03312.72
5.3.230.0050.04812.71
5.3.220.0040.05112.68
5.3.210.0070.04312.68
5.3.200.0080.04512.68
5.3.190.0060.03712.68
5.3.180.0090.03512.68
5.3.170.0090.03612.67
5.3.160.0100.04412.67
5.3.150.0110.03812.67
5.3.140.0040.03912.66
5.3.130.0090.03612.66
5.3.120.0030.04212.66
5.3.110.0060.04412.66
5.3.100.0080.03812.12
5.3.90.0040.03712.11
5.3.80.0030.04112.11
5.3.70.0060.04212.10
5.3.60.0090.03512.09
5.3.50.0080.03712.04
5.3.40.0090.03612.04
5.3.30.0080.04211.99
5.3.20.0060.03711.78
5.3.10.0080.03511.73
5.3.00.0080.04011.73
5.2.170.0060.0289.22
5.2.160.0080.0309.21
5.2.150.0060.0379.22
5.2.140.0040.0309.21
5.2.130.0060.0329.17
5.2.120.0080.0319.17
5.2.110.0060.0379.18
5.2.100.0100.0259.18
5.2.90.0080.0349.18
5.2.80.0050.0329.18
5.2.70.0070.0359.18
5.2.60.0040.0339.13
5.2.50.0080.0389.10
5.2.40.0070.0319.08
5.2.30.0040.0379.05
5.2.20.0050.0309.04
5.2.10.0070.0258.95
5.2.00.0080.0348.81
5.1.60.0070.0328.10
5.1.50.0060.0308.09
5.1.40.0070.0338.07
5.1.30.0090.0298.42
5.1.20.0050.0368.43
5.1.10.0070.0298.16
5.1.00.0060.0288.17
5.0.50.0030.0256.64
5.0.40.0040.0266.50
5.0.30.0020.0336.31
5.0.20.0010.0296.28
5.0.10.0030.0226.25
5.0.00.0040.0366.25
4.4.90.0050.0134.78
4.4.80.0020.0164.75
4.4.70.0040.0144.75
4.4.60.0050.0154.76
4.4.50.0040.0154.77
4.4.40.0030.0274.71
4.4.30.0030.0204.76
4.4.20.0040.0154.84
4.4.10.0060.0174.85
4.4.00.0030.0284.76
4.3.110.0060.0194.67
4.3.100.0040.0144.66
4.3.90.0040.0234.63
4.3.80.0020.0314.58
4.3.70.0050.0154.63
4.3.60.0030.0184.63
4.3.50.0040.0144.63
4.3.40.0020.0244.53
4.3.30.0020.0213.30
4.3.20.0030.0203.28
4.3.10.0030.0153.23
4.3.00.0170.0237.27

preferences:
42.83 ms | 400 KiB | 5 Q