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 ?: 'no declaring class'; 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.00318.18
8.3.50.0160.00521.97
8.3.40.0090.01218.80
8.3.30.0070.00719.13
8.3.20.0040.00420.20
8.3.10.0050.00320.47
8.3.00.0000.00819.38
8.2.180.0100.00616.62
8.2.170.0180.00322.96
8.2.160.0070.00720.28
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0000.00720.86
8.2.110.0060.00320.51
8.2.100.0120.00317.91
8.2.90.0000.00919.36
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0090.00018.05
8.2.50.0000.00918.07
8.2.40.0080.00018.26
8.2.30.0000.00919.39
8.2.20.0000.00817.91
8.2.10.0040.00418.30
8.2.00.0030.00617.85
8.1.280.0030.01425.92
8.1.270.0040.00423.84
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00923.65
8.1.230.0030.00719.01
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.01017.10
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0060.00318.51
8.1.160.0040.00421.91
8.1.150.0000.00718.99
8.1.140.0000.00917.54
8.1.130.0040.00417.88
8.1.120.0040.00417.49
8.1.110.0030.00517.47
8.1.100.0040.00417.54
8.1.90.0070.00017.40
8.1.80.0040.00417.47
8.1.70.0070.00017.48
8.1.60.0040.00417.54
8.1.50.0040.00417.60
8.1.40.0080.00017.57
8.1.30.0060.00317.53
8.1.20.0050.00317.66
8.1.10.0050.00317.62
8.1.00.0040.00417.57
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.48
8.0.270.0040.00417.31
8.0.260.0040.00417.28
8.0.250.0070.00016.99
8.0.240.0040.00417.07
8.0.230.0000.00817.09
8.0.220.0000.00716.98
8.0.210.0030.00316.94
8.0.200.0030.00317.12
8.0.190.0060.00317.13
8.0.180.0040.00416.95
8.0.170.0000.00917.03
8.0.160.0050.00316.99
8.0.150.0000.00816.88
8.0.140.0050.00216.82
8.0.130.0060.00013.38
8.0.120.0050.00316.83
8.0.110.0050.00317.00
8.0.100.0000.00717.04
8.0.90.0000.00716.95
8.0.80.0060.00917.00
8.0.70.0080.00017.07
8.0.60.0040.00416.98
8.0.50.0000.00716.89
8.0.30.0150.01017.19
8.0.20.0120.00917.40
8.0.10.0000.00817.01
8.0.00.0080.01216.95
7.4.330.0050.00015.00
7.4.320.0030.00316.56
7.4.300.0060.00016.55
7.4.290.0000.00616.56
7.4.280.0000.00816.55
7.4.270.0040.00416.57
7.4.260.0070.00016.61
7.4.250.0050.00316.60
7.4.240.0010.00616.60
7.4.230.0030.00316.34
7.4.220.0120.00616.68
7.4.210.0060.00916.75
7.4.200.0020.00516.64
7.4.160.0090.01116.52
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0090.01316.68
7.4.120.0100.00816.63
7.4.110.0030.01416.57
7.4.100.0100.00716.68
7.4.90.0130.00416.70
7.4.80.0140.00619.39
7.4.70.0110.00816.54
7.4.60.0090.01216.54
7.4.50.0040.00416.18
7.4.40.0120.00616.68
7.4.30.0170.00016.59
7.4.00.0020.01315.00
7.3.330.0030.00313.32
7.3.320.0000.00513.27
7.3.310.0000.00716.41
7.3.300.0000.00716.30
7.3.290.0100.00416.41
7.3.280.0100.00616.36
7.3.270.0060.01217.40
7.3.260.0070.01816.52
7.3.250.0110.00616.64
7.3.240.0070.01416.32
7.3.230.0100.00716.39
7.3.210.0090.00916.73
7.3.200.0100.01019.39
7.3.190.0060.01316.61
7.3.180.0090.00916.67
7.3.170.0040.01416.48
7.3.160.0070.01316.34
7.3.120.0160.00314.59
7.3.110.0070.01115.08
7.3.100.0060.00914.98
7.3.90.0070.00715.09
7.3.80.0000.00914.67
7.3.70.0110.00314.99
7.3.60.0000.01414.94
7.3.50.0100.00714.69
7.3.40.0030.01014.88
7.3.30.0060.00914.68
7.3.20.0120.00316.64
7.3.10.0080.00816.43
7.3.00.0000.01416.75
7.2.330.0140.00316.82
7.2.320.0030.01616.54
7.2.310.0100.00716.87
7.2.300.0040.01216.41
7.2.290.0030.01316.73
7.2.250.0060.01215.25
7.2.240.0120.00615.39
7.2.230.0090.00615.25
7.2.220.0040.01114.95
7.2.210.0000.01014.98
7.2.200.0030.01314.85
7.2.190.0030.00615.16
7.2.180.0060.00815.07
7.2.170.0060.00915.07
7.2.160.0030.00615.16
7.2.150.0120.00317.02
7.2.140.0040.00816.95
7.2.130.0060.00917.13
7.2.120.0050.00417.02
7.2.110.0000.01016.72
7.2.100.0040.01116.75
7.2.90.0030.00617.08
7.2.80.0060.00616.86
7.2.70.0030.00617.11
7.2.60.0110.00317.01
7.2.50.0090.00916.96
7.2.40.0040.00716.81
7.2.30.0110.00416.89
7.2.20.0030.01317.18
7.2.10.0060.00616.72
7.2.00.0060.01118.04
7.1.330.0100.01015.86
7.1.320.0060.01015.96
7.1.310.0050.00515.92
7.1.300.0030.01015.91
7.1.290.0040.00415.76
7.1.280.0100.00715.84
7.1.270.0060.00615.86
7.1.260.0030.00815.71
7.1.250.0060.00615.99
7.1.240.0030.00615.71
7.1.230.0080.00315.54
7.1.220.0120.00315.85
7.1.210.0070.00715.88
7.1.200.0060.00615.68
7.1.190.0040.01115.48
7.1.180.0090.00616.02
7.1.170.0030.01015.79
7.1.160.0030.01015.99
7.1.150.0090.00015.92
7.1.140.0030.00915.72
7.1.130.0000.01015.93
7.1.120.0030.00915.88
7.1.110.0130.00315.98
7.1.100.0030.00917.02
7.1.90.0060.00615.65
7.1.80.0030.01315.98
7.1.70.0020.00916.55
7.1.60.0090.01117.81
7.1.50.0080.00816.27
7.1.40.0030.01415.88
7.1.30.0070.00715.82
7.1.20.0060.00615.70
7.1.10.0080.00615.91
7.1.00.0030.04419.25
7.0.330.0040.00815.42
7.0.320.0000.01015.44
7.0.310.0040.00415.52
7.0.300.0090.00015.44
7.0.290.0030.01215.22
7.0.280.0040.00415.23
7.0.270.0000.01115.34
7.0.260.0030.01415.47
7.0.250.0060.00615.36
7.0.240.0070.00415.44
7.0.230.0030.01015.29
7.0.220.0060.00315.46
7.0.210.0030.01015.40
7.0.200.0250.00714.94
7.0.190.0060.01415.50
7.0.180.0030.00815.46
7.0.170.0130.00315.47
7.0.160.0000.01315.57
7.0.150.0060.00815.57
7.0.140.0020.04318.82
7.0.130.0030.01015.16
7.0.120.0000.01115.35
7.0.110.0030.00615.18
7.0.100.0100.02617.63
7.0.90.0170.02517.75
7.0.80.0080.02717.68
7.0.70.0080.03117.66
7.0.60.0150.04317.57
7.0.50.0120.02717.95
7.0.40.0100.04216.84
7.0.30.0050.04616.87
7.0.20.0000.03316.84
7.0.10.0100.02716.84
7.0.00.0070.03416.76
5.6.400.0000.01514.18
5.6.390.0040.00714.38
5.6.380.0080.00814.32
5.6.370.0000.01314.41
5.6.360.0040.00714.50
5.6.350.0090.00614.35
5.6.340.0110.00414.20
5.6.330.0120.00614.46
5.6.320.0100.00714.46
5.6.310.0070.00714.56
5.6.300.0000.01314.21
5.6.290.0030.01014.54
5.6.280.0080.03717.72
5.6.270.0100.00714.63
5.6.260.0080.00414.36
5.6.250.0030.03817.49
5.6.240.0050.02717.39
5.6.230.0140.02717.65
5.6.220.0060.02317.46
5.6.210.0050.02717.54
5.6.200.0070.04717.72
5.6.190.0070.04517.58
5.6.180.0060.02817.76
5.6.170.0040.04417.78
5.6.160.0050.02617.58
5.6.150.0080.03817.53
5.6.140.0020.02917.72
5.6.130.0080.02317.81
5.6.120.0100.04017.63
5.6.110.0100.03017.80
5.6.100.0110.02317.77
5.6.90.0100.03717.69
5.6.80.0040.04517.26
5.6.70.0030.04817.31
5.6.60.0000.04117.50
5.6.50.0030.04517.25
5.6.40.0090.02217.51
5.6.30.0100.02317.47
5.6.20.0130.03317.33
5.6.10.0070.02417.32
5.6.00.0120.04017.33
5.5.380.0030.04717.44
5.5.370.0030.02517.45
5.5.360.0030.02917.36
5.5.350.0050.02717.38
5.5.340.0120.03717.63
5.5.330.0050.03117.45
5.5.320.0050.02917.55
5.5.310.0070.03617.67
5.5.300.0080.03617.68
5.5.290.0090.03617.63
5.5.280.0050.04517.52
5.5.270.0060.04217.59
5.5.260.0050.02717.60
5.5.250.0080.04017.53
5.5.240.0120.04317.24
5.5.230.0080.03017.30
5.5.220.0090.03717.18
5.5.210.0090.02117.30
5.5.200.0110.03817.33
5.5.190.0050.02517.32
5.5.180.0030.03817.17
5.5.170.0070.00714.41
5.5.160.0120.04017.24
5.5.150.0080.04117.23
5.5.140.0030.02517.11
5.5.130.0110.01817.31
5.5.120.0020.02617.39
5.5.110.0080.02117.18
5.5.100.0070.03517.28
5.5.90.0020.04417.14
5.5.80.0100.04017.25
5.5.70.0050.04617.25
5.5.60.0110.04117.30
5.5.50.0060.02117.10
5.5.40.0060.03117.26
5.5.30.0050.02417.13
5.5.20.0100.04017.31
5.5.10.0060.02417.07
5.5.00.0060.02617.21
5.4.450.0080.03716.40
5.4.440.0090.02216.57
5.4.430.0000.03016.47
5.4.420.0050.04116.57
5.4.410.0070.04216.31
5.4.400.0060.02116.23
5.4.390.0120.03116.34
5.4.380.0100.01816.40
5.4.370.0090.01816.32
5.4.360.0100.04416.27
5.4.350.0070.03216.36
5.4.340.0030.02516.23
5.4.330.0040.00713.59
5.4.320.0020.03016.32
5.4.310.0100.01916.34
5.4.300.0050.03516.31
5.4.290.0090.04016.38
5.4.280.0060.04316.24
5.4.270.0080.03916.36
5.4.260.0100.03316.24
5.4.250.0020.04316.23
5.4.240.0100.03516.24
5.4.230.0130.02716.37
5.4.220.0030.02616.21
5.4.210.0030.02316.31
5.4.200.0030.02516.26
5.4.190.0030.02716.26
5.4.180.0020.02216.40
5.4.170.0020.02916.40
5.4.160.0100.02216.37
5.4.150.0040.02416.35
5.4.140.0100.04014.99
5.4.130.0090.03015.04
5.4.120.0070.01815.03
5.4.110.0070.03414.99
5.4.100.0040.03315.05
5.4.90.0080.02715.00
5.4.80.0030.03215.03
5.4.70.0030.04214.96
5.4.60.0030.03214.97
5.4.50.0030.02915.00
5.4.40.0060.03815.04
5.4.30.0060.02515.03
5.4.20.0050.04015.02
5.4.10.0100.02815.02
5.4.00.0050.03514.79
5.3.290.0030.08014.81
5.3.280.0130.03714.57
5.3.270.0030.07014.72
5.3.260.0100.07314.68
5.3.250.0000.07714.70
5.3.240.0100.07314.73
5.3.230.0070.05014.74
5.3.220.0100.03014.55
5.3.210.0070.03714.51
5.3.200.0100.02714.68
5.3.190.0100.05714.56
5.3.180.0100.04014.50
5.3.170.0070.05714.50
5.3.160.0070.03314.54
5.3.150.0100.06314.51
5.3.140.0070.04314.63
5.3.130.0100.08014.62
5.3.120.0100.07714.51
5.3.110.0100.07014.54
5.3.100.0000.04014.02
5.3.90.0070.06014.08
5.3.80.0070.07013.93
5.3.70.0000.07714.03
5.3.60.0100.07313.91
5.3.50.0070.07013.98
5.3.40.0170.05314.02
5.3.30.0100.05013.93
5.3.20.0030.05713.77
5.3.10.0070.05313.59
5.3.00.0130.04313.66
5.2.170.0030.05711.26
5.2.160.0030.06311.04
5.2.150.0100.06011.21
5.2.140.0030.07011.00
5.2.130.0170.02011.11
5.2.120.0100.03711.22
5.2.110.0000.05311.10
5.2.100.0100.03011.20
5.2.90.0100.04311.01
5.2.80.0070.05711.23
5.2.70.0030.07011.02
5.2.60.0000.03310.90
5.2.50.0000.05010.90
5.2.40.0030.05710.89
5.2.30.0030.06310.96
5.2.20.0100.05311.02
5.2.10.0070.06010.85
5.2.00.0000.06310.75
5.1.60.0070.03310.00
5.1.50.0030.0439.98
5.1.40.0100.0539.82
5.1.30.0030.02710.41
5.1.20.0030.02710.42
5.1.10.0030.05710.18
5.1.00.0070.0479.95
5.0.50.0000.0479.08
5.0.40.0070.0179.08
5.0.30.0030.0639.08
5.0.20.0000.0439.08
5.0.10.0100.0409.08
5.0.00.0000.0339.08
4.4.90.0030.0309.08
4.4.80.0030.0379.08
4.4.70.0070.0339.08
4.4.60.0000.0239.08
4.4.50.0000.0279.08
4.4.40.0000.0479.08
4.4.30.0000.0239.08
4.4.20.0000.0539.08
4.4.10.0030.0339.08
4.4.00.0000.0539.08
4.3.110.0000.0379.08
4.3.100.0070.0209.08
4.3.90.0030.0139.08
4.3.80.0030.0539.08
4.3.70.0000.0339.08
4.3.60.0000.0409.08
4.3.50.0000.0239.08
4.3.40.0000.0279.08
4.3.30.0000.0339.08
4.3.20.0030.0279.08
4.3.10.0000.0239.08
4.3.00.0000.0379.08

preferences:
44.89 ms | 401 KiB | 5 Q