3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(ReflectionFunctionAbstract $r) { echo 'isClosure(): '; var_dump($r->isClosure()); if ($r instanceof ReflectionMethod) { $rc = $r->getDeclaringClass(); $dc = $rc ? $rc->getName() : 'no declaring class'; } else { $dc = 'not a ReflectionMethod'; } echo 'getDeclaringClass(): ' . $dc; echo "\n"; $csc = $r->getClosureScopeClass(); echo 'getClosureScopeClass(): ' . ($csc ? $csc->getName() : 'no closure scope class'); echo "\n"; echo "\n"; } class C { function f() { return function($p) {}; } } $c = new C; $cl = $c->f(); // instantiate ReflectionFunction directly on closure $rf = new ReflectionFunction($cl); test($rf); // get ReflectionFunction via one of the initial ReflectionFunction's ReflectionParameter objects $rps = $rf->getParameters(); $rp = $rps[0]; test($rp->getDeclaringFunction());

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.0140.00718.31
8.3.50.0090.00822.00
8.3.40.0000.01518.74
8.3.30.0080.00819.04
8.3.20.0080.00020.30
8.3.10.0090.00020.38
8.3.00.0080.00019.25
8.2.180.0160.00016.75
8.2.170.0070.00722.96
8.2.160.0100.00320.52
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00020.96
8.2.110.0100.00022.12
8.2.100.0110.00019.66
8.2.90.0040.00719.17
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0000.00818.26
8.2.30.0040.00419.48
8.2.20.0030.00617.70
8.2.10.0050.00318.07
8.2.00.0000.00917.78
8.1.280.0110.00425.92
8.1.270.0060.00323.96
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0030.00623.92
8.1.230.0080.00419.07
8.1.220.0080.00017.75
8.1.210.0030.00618.77
8.1.200.0040.00817.22
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00818.49
8.1.160.0040.00421.96
8.1.150.0040.00418.80
8.1.140.0030.00617.41
8.1.130.0050.00217.49
8.1.120.0040.00417.48
8.1.110.0000.00817.40
8.1.100.0000.00817.51
8.1.90.0000.00817.41
8.1.80.0000.00717.52
8.1.70.0000.00717.48
8.1.60.0000.00917.64
8.1.50.0000.00817.42
8.1.40.0050.00217.56
8.1.30.0000.00917.50
8.1.20.0000.00817.54
8.1.10.0040.00417.64
8.1.00.0000.00817.43
8.0.300.0000.00718.77
8.0.290.0000.00717.00
8.0.280.0030.00318.53
8.0.270.0040.00417.23
8.0.260.0030.00616.98
8.0.250.0030.00317.08
8.0.240.0030.00517.10
8.0.230.0080.00017.07
8.0.220.0030.00316.90
8.0.210.0030.00317.03
8.0.200.0060.00016.92
8.0.190.0000.01117.07
8.0.180.0000.00717.04
8.0.170.0040.00417.04
8.0.160.0000.00716.85
8.0.150.0070.00016.83
8.0.140.0040.00416.95
8.0.130.0000.00613.44
8.0.120.0040.00417.01
8.0.110.0040.00416.98
8.0.100.0040.00417.05
8.0.90.0040.00417.01
8.0.80.0120.00316.95
8.0.70.0050.00216.89
8.0.60.0040.00416.87
8.0.50.0030.00316.87
8.0.30.0140.01017.20
8.0.20.0110.00917.40
8.0.10.0040.00416.97
8.0.00.0110.00716.96
7.4.330.0000.00515.00
7.4.320.0060.00016.66
7.4.300.0030.00316.63
7.4.290.0040.00416.54
7.4.280.0000.00716.39
7.4.270.0000.00716.57
7.4.260.0050.00316.55
7.4.250.0040.00416.50
7.4.240.0050.00316.55
7.4.230.0040.00416.71
7.4.220.0120.01216.71
7.4.210.0100.00316.51
7.4.200.0030.00616.53
7.4.160.0120.00616.47
7.4.150.0100.00717.40
7.4.140.0110.00817.86
7.4.130.0090.00916.64
7.4.120.0050.01316.53
7.4.110.0130.00316.52
7.4.100.0100.00716.43
7.4.90.0170.00016.53
7.4.80.0030.01619.39
7.4.70.0080.01316.64
7.4.60.0030.01316.49
7.4.50.0050.00316.44
7.4.40.0180.00416.48
7.4.30.0060.00916.26
7.4.00.0030.01315.03
7.3.330.0060.00013.41
7.3.320.0030.00313.18
7.3.310.0030.00316.41
7.3.300.0030.00316.48
7.3.290.0030.01116.47
7.3.280.0060.01116.37
7.3.270.0090.00917.40
7.3.260.0180.00616.34
7.3.250.0090.00916.58
7.3.240.0040.01516.39
7.3.230.0120.00616.62
7.3.210.0140.00316.46
7.3.200.0100.00719.39
7.3.190.0090.00916.38
7.3.180.0050.01016.68
7.3.170.0100.00716.59
7.3.160.0070.01316.51
7.3.10.0070.01116.76
7.3.00.0090.00616.39
7.2.330.0110.00616.87
7.2.320.0060.01216.87
7.2.310.0130.00716.48
7.2.300.0080.00816.87
7.2.290.0090.00916.78
7.2.130.0080.00416.86
7.2.120.0060.00617.05
7.2.110.0000.01316.82
7.2.100.0040.00816.82
7.2.90.0040.00416.82
7.2.80.0100.00316.70
7.2.70.0000.01417.07
7.2.60.0060.01017.04
7.2.50.0090.00316.76
7.2.40.0040.01216.74
7.2.30.0030.01217.02
7.2.20.0030.01517.00
7.2.10.0000.01016.97
7.2.00.0070.01118.18
7.1.250.0060.00615.66
7.1.240.0070.01015.84
7.1.230.0090.00315.90
7.1.220.0060.00615.74
7.1.210.0000.00815.75
7.1.200.0030.00915.95
7.1.190.0060.00915.94
7.1.180.0000.01015.79
7.1.170.0060.01015.93
7.1.160.0100.00315.75
7.1.150.0000.01015.85
7.1.140.0030.01215.91
7.1.130.0070.00715.86
7.1.120.0180.00016.00
7.1.110.0070.00715.80
7.1.100.0040.00817.18
7.1.90.0070.00715.73
7.1.80.0060.00615.64
7.1.70.0020.01016.35
7.1.60.0070.01017.81
7.1.50.0090.01016.50
7.1.40.0000.00915.83
7.1.30.0100.00316.03
7.1.20.0060.00615.87
7.1.10.0030.00715.62
7.1.00.0030.04419.00
7.0.330.0040.00715.46
7.0.320.0040.00715.21
7.0.310.0100.00315.25
7.0.300.0030.01015.37
7.0.290.0070.00715.23
7.0.280.0030.00715.38
7.0.270.0040.00815.39
7.0.260.0100.00315.20
7.0.250.0080.00315.32
7.0.240.0090.00015.49
7.0.230.0070.00715.34
7.0.220.0040.00415.30
7.0.210.0000.01415.16
7.0.200.0120.00515.14
7.0.190.0070.00715.51
7.0.180.0070.00715.38
7.0.170.0060.00615.28
7.0.160.0040.00715.26
7.0.150.0140.00015.35
7.0.140.0080.03518.56
7.0.130.0130.00015.18
7.0.120.0060.00615.30
7.0.110.0070.00715.37
7.0.100.0090.00915.33
7.0.90.0030.00915.19
7.0.80.0030.01015.33
7.0.70.0060.01015.32
7.0.60.0080.03317.62
7.0.50.0020.05016.59
7.0.40.0080.04616.82
7.0.30.0170.03816.79
7.0.20.0200.02016.72
7.0.10.0100.02416.80
7.0.00.0070.04616.55
5.6.380.0130.00314.29
5.6.370.0000.01214.09
5.6.360.0000.01514.22
5.6.350.0040.00714.38
5.6.340.0000.01314.23
5.6.330.0040.01114.24
5.6.320.0070.00714.45
5.6.310.0030.01014.39
5.6.300.0040.00814.53
5.6.290.0120.00314.07
5.6.280.0050.03817.82
5.6.270.0110.00314.29
5.6.260.0000.00814.21
5.6.250.0030.00614.35
5.6.240.0040.01114.34
5.6.230.0070.00714.07
5.6.220.0110.00014.34
5.6.210.0020.04617.34
5.6.200.0090.02516.10
5.6.190.0070.04517.38
5.6.180.0170.02417.41
5.6.170.0140.04117.39
5.6.160.0090.04417.42
5.6.150.0120.02316.21
5.6.140.0100.04116.43
5.6.130.0030.05116.44
5.6.120.0050.04717.80
5.6.110.0070.04017.66
5.6.100.0080.03817.74
5.6.90.0090.04017.72
5.6.80.0050.04717.39
5.6.70.2300.02717.32
5.6.60.0090.00614.21
5.6.50.0000.01614.13
5.6.40.0060.00614.45
5.6.30.0040.00814.40
5.6.20.0040.01414.34
5.6.10.0040.00714.50
5.6.00.0070.00714.22
5.5.380.0040.00711.34
5.5.370.0000.00711.05
5.5.360.0080.00311.08
5.5.350.0000.02515.85
5.5.340.0100.03914.54
5.5.330.0110.03615.70
5.5.320.0170.04315.80
5.5.310.0070.04815.62
5.5.300.0020.03314.58
5.5.290.0010.04814.54
5.5.280.0090.03816.00
5.5.270.0070.04315.89
5.5.260.0050.04815.90
5.5.250.0070.04215.81
5.5.240.0080.02815.50
5.5.230.0000.01111.11
5.5.220.0030.00611.08
5.5.210.0000.01010.91
5.5.200.0070.00610.73
5.5.190.0060.00611.17
5.5.180.0090.00311.25
5.5.170.0110.00011.06
5.5.160.0060.00310.95
5.5.150.0030.01011.04
5.5.140.0070.00711.16
5.5.130.0030.00611.32
5.5.120.0060.00610.80
5.5.110.0080.00311.19
5.5.100.0040.00410.98
5.5.90.0030.00711.36
5.5.80.0030.00310.95
5.5.70.0000.00711.04
5.5.60.0070.00310.96
5.5.50.0080.00411.27
5.5.40.0070.00311.42
5.5.30.0060.00011.25
5.5.20.0040.00711.27
5.5.10.0100.00011.04
5.5.00.0120.00411.21
5.4.450.0480.02115.17
5.4.440.0250.02615.38
5.4.430.0260.02415.29
5.4.420.0160.02615.17
5.4.410.0220.02615.06
5.4.400.0300.02115.11
5.4.390.0150.02514.91
5.4.380.0150.03714.88
5.4.370.0170.03014.75
5.4.360.0170.02814.73
5.4.350.0170.03814.88
5.4.340.0180.03014.94
5.4.330.0000.00811.02
5.4.320.0070.01911.77
5.4.310.0050.02411.58
5.4.300.0040.02511.63
5.4.290.0060.02611.75
5.4.280.0070.02211.74
5.4.270.0070.02111.60
5.4.260.0050.02611.56
5.4.250.0090.01811.77
5.4.240.0080.02211.64
5.4.230.0050.02511.77
5.4.220.0060.01811.85
5.4.210.0080.02011.81
5.4.200.0090.02811.73
5.4.190.0040.02411.76
5.4.180.0070.02211.69
5.4.170.0110.02111.75
5.4.160.0110.02111.69
5.4.150.0060.02411.57
5.4.140.0080.02411.63
5.4.130.0040.02511.62
5.4.120.0040.02711.38
5.4.110.0070.02311.45
5.4.100.0060.02111.53
5.4.90.0080.02711.55
5.4.80.0040.02411.64
5.4.70.0050.02111.44
5.4.60.0050.02411.62
5.4.50.0040.02311.52
5.4.40.0060.02211.48
5.4.30.0060.02211.52
5.4.20.0050.02211.53
5.4.10.0080.02411.49
5.4.00.0090.01911.16
5.3.290.0050.02711.80
5.3.280.0090.02411.63
5.3.270.0040.02411.67
5.3.260.0080.02511.70
5.3.250.0040.02411.67
5.3.240.0060.02411.62
5.3.230.0070.02211.71
5.3.220.0050.02211.62
5.3.210.0080.02011.59
5.3.200.0070.01811.47
5.3.190.0080.02311.56
5.3.180.0040.02311.56
5.3.170.0060.02011.65
5.3.160.0070.01911.68
5.3.150.0070.02011.65
5.3.140.0070.02311.64
5.3.130.0040.02511.63
5.3.120.0070.02911.67
5.3.110.0080.02411.53
5.3.100.0080.02111.40
5.3.90.0050.02111.43
5.3.80.0060.02411.36
5.3.70.0020.02311.22
5.3.60.0070.02511.34
5.3.50.0040.03011.31
5.3.40.0020.02811.21
5.3.30.0060.02411.35
5.3.20.0060.02311.08
5.3.10.0060.02211.16
5.3.00.0060.02511.05
5.2.170.0050.0179.32
5.2.160.0090.0149.32
5.2.150.0060.0179.32
5.2.140.0070.0159.32
5.2.130.0060.0149.30
5.2.120.0050.0179.30
5.2.110.0030.0169.30
5.2.100.0040.0169.31
5.2.90.0040.0159.30
5.2.80.0050.0189.30
5.2.70.0040.0239.30
5.2.60.0090.0209.27
5.2.50.0050.0169.26
5.2.40.0060.0179.25
5.2.30.0070.0159.24
5.2.20.0060.0179.23
5.2.10.0050.0189.18
5.2.00.0040.0199.12
5.1.60.0050.0158.75
5.1.50.0100.0128.75
5.1.40.0030.0168.75
5.1.30.0020.0198.92
5.1.20.0050.0198.93
5.1.10.0070.0158.79
5.1.00.0060.0148.79
5.0.50.0050.0168.03
5.0.40.0040.0137.96
5.0.30.0030.0217.87
5.0.20.0090.0147.85
5.0.10.0040.0127.84
5.0.00.0040.0167.84
4.4.90.0050.0077.10
4.4.80.0040.0127.09
4.4.70.0040.0137.08
4.4.60.0050.0127.08
4.4.50.0040.0117.09
4.4.40.0050.0147.06
4.4.30.0040.0107.09
4.4.20.0040.0137.13
4.4.10.0050.0107.13
4.4.00.0060.0127.09
4.3.110.0040.0147.04
4.3.100.0030.0137.04
4.3.90.0040.0147.03
4.3.80.0030.0157.00
4.3.70.0050.0097.02
4.3.60.0040.0107.02
4.3.50.0030.0127.02
4.3.40.0020.0156.97
4.3.30.0000.0146.36
4.3.20.0040.0116.35
4.3.10.0030.0096.33
4.3.00.0060.00713.06

preferences:
40.54 ms | 400 KiB | 5 Q