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) {}; } function f2() { $cl = $this->f(); $c2 = new C2; $cl->bindTo($c2); return $cl; } } class C2 {} $c = new C; $cl = $c->f(); $rf = new ReflectionFunction($cl); test($rf); $rps = $rf->getParameters(); $rp = $rps[0]; test($rp->getDeclaringFunction()); $cl = $c->f2(); $rf = new ReflectionFunction($cl); test($rf); $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.0120.00618.14
8.3.50.0130.00522.08
8.3.40.0080.00818.69
8.3.30.0090.00619.09
8.3.20.0060.00320.35
8.3.10.0080.00020.54
8.3.00.0000.00819.38
8.2.180.0040.01416.75
8.2.170.0070.00722.96
8.2.160.0100.00320.52
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00721.22
8.2.110.0030.00621.99
8.2.100.0060.00617.84
8.2.90.0040.00419.17
8.2.80.0000.00817.97
8.2.70.0040.00417.62
8.2.60.0050.00318.04
8.2.50.0030.00618.07
8.2.40.0040.00418.28
8.2.30.0070.00019.51
8.2.20.0000.00817.68
8.2.10.0060.00318.10
8.2.00.0050.00317.85
8.1.280.0000.01525.92
8.1.270.0040.00423.97
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0060.00323.61
8.1.230.0110.00018.97
8.1.220.0030.00617.74
8.1.210.0060.00318.77
8.1.200.0050.00517.13
8.1.190.0080.00017.22
8.1.180.0000.00818.10
8.1.170.0040.00418.57
8.1.160.0050.00222.05
8.1.150.0000.00718.89
8.1.140.0000.00817.55
8.1.130.0000.00717.79
8.1.120.0040.00417.46
8.1.110.0000.00817.50
8.1.100.0040.00417.53
8.1.90.0000.00717.48
8.1.80.0030.00317.47
8.1.70.0030.00317.45
8.1.60.0030.00617.68
8.1.50.0090.00017.63
8.1.40.0030.00617.52
8.1.30.0040.00417.56
8.1.20.0000.00817.65
8.1.10.0000.00817.50
8.1.00.0040.00417.44
8.0.300.0070.00018.77
8.0.290.0000.00716.75
8.0.280.0000.00718.36
8.0.270.0030.00317.29
8.0.260.0000.00717.21
8.0.250.0030.00317.03
8.0.240.0030.00317.06
8.0.230.0030.00317.05
8.0.220.0050.00217.01
8.0.210.0040.00316.96
8.0.200.0030.00316.94
8.0.190.0040.00717.08
8.0.180.0000.00817.01
8.0.170.0060.00316.92
8.0.160.0030.00616.86
8.0.150.0030.00316.78
8.0.140.0000.00716.79
8.0.130.0030.00313.45
8.0.120.0030.00516.95
8.0.110.0000.00816.95
8.0.100.0070.00016.88
8.0.90.0070.00017.02
8.0.80.0060.01317.02
8.0.70.0040.00416.87
8.0.60.0000.00817.02
8.0.50.0000.00716.97
8.0.30.0020.02417.14
8.0.20.0150.00717.40
8.0.10.0030.00517.09
8.0.00.0070.01016.94
7.4.330.0050.00015.00
7.4.320.0060.00016.63
7.4.300.0060.00016.67
7.4.290.0000.00716.53
7.4.280.0030.00616.62
7.4.270.0000.00716.53
7.4.260.0050.00316.45
7.4.250.0000.00716.57
7.4.240.0020.00516.50
7.4.230.0030.00316.35
7.4.220.0120.00616.68
7.4.210.0100.00316.71
7.4.200.0000.00716.45
7.4.160.0030.01216.66
7.4.150.0150.01117.40
7.4.140.0120.00517.86
7.4.130.0110.01016.51
7.4.120.0120.00716.65
7.4.110.0150.00916.50
7.4.100.0060.01016.52
7.4.90.0070.01016.52
7.4.80.0130.00919.39
7.4.70.0080.00916.54
7.4.60.0110.01116.67
7.4.50.0050.00016.44
7.4.40.0060.01516.25
7.4.30.0090.00916.61
7.4.00.0070.01014.77
7.3.330.0000.00613.41
7.3.320.0050.00013.36
7.3.310.0070.00016.43
7.3.300.0030.00316.34
7.3.290.0070.01016.41
7.3.280.0090.00916.40
7.3.270.0140.01017.40
7.3.260.0100.00716.45
7.3.250.0130.00716.59
7.3.240.0070.01116.54
7.3.230.0080.00816.51
7.3.210.0090.01216.67
7.3.200.0140.00319.39
7.3.190.0090.00916.39
7.3.180.0070.01016.70
7.3.170.0070.01116.36
7.3.160.0130.00716.66
7.2.330.0090.00916.43
7.2.320.0100.01016.71
7.2.310.0230.00016.51
7.2.300.0060.01216.47
7.2.290.0060.01016.56
7.2.60.0180.00416.94
7.2.00.0000.01519.36
7.1.200.0110.00415.61
7.1.100.0000.01318.00
7.1.70.0040.00717.16
7.1.60.0090.01519.61
7.1.50.0100.01416.73
7.1.00.0070.07322.50
7.0.200.0340.00714.76
7.0.140.0030.07322.09
7.0.60.0000.08019.95
7.0.50.0030.05717.91
7.0.40.0070.04320.27
7.0.30.0370.04720.21
7.0.20.0170.04320.26
7.0.10.0030.05020.07
7.0.00.0030.06020.14
5.6.280.0000.07721.01
5.6.210.0200.06320.74
5.6.200.0030.04018.25
5.6.190.0100.04020.42
5.6.180.0300.05020.77
5.6.170.0300.08320.48
5.6.160.0070.05020.46
5.6.150.0030.04718.21
5.6.140.0070.08318.24
5.6.130.0000.08718.16
5.6.120.0070.05021.16
5.6.110.0100.08021.00
5.6.100.0030.09021.09
5.6.90.0030.04021.00
5.6.80.0100.05320.42
5.6.70.4300.03720.37
5.5.350.0130.03720.34
5.5.340.0100.03717.98
5.5.330.0000.04320.33
5.5.320.0270.04720.32
5.5.310.0370.07320.37
5.5.300.0100.08317.93
5.5.290.0070.03718.00
5.5.280.0130.04720.79
5.5.270.0100.08320.79
5.5.260.0100.08320.91
5.5.250.0070.07020.59
5.5.240.3700.03720.15
5.4.450.0600.03319.56
5.4.440.0270.03319.17
5.4.430.0100.04719.48
5.4.420.0430.04319.47
5.4.410.0500.03719.44
5.4.400.0570.04019.17
5.4.390.0300.05019.09
5.4.380.0430.07018.80
5.4.370.0330.05018.79
5.4.360.0270.06018.76
5.4.350.0370.06318.60
5.4.340.0400.05318.60
5.4.320.0040.03812.52
5.4.310.0070.03812.52
5.4.300.0060.03912.52
5.4.290.0050.04412.52
5.4.280.0040.04112.41
5.4.270.0040.03912.41
5.4.260.0060.03812.41
5.4.250.0060.03812.41
5.4.240.0060.04712.41
5.4.230.0070.05112.41
5.4.220.0060.03612.40
5.4.210.0070.03412.41
5.4.200.0080.03612.41
5.4.190.0080.03412.40
5.4.180.0060.04012.40
5.4.170.0030.04012.41
5.4.160.0080.03312.41
5.4.150.0060.03512.40
5.4.140.0040.03912.09
5.4.130.0070.03412.08
5.4.120.0060.03512.03
5.4.110.0100.04812.03
5.4.100.0080.03612.03
5.4.90.0070.03512.03
5.4.80.0060.03612.03
5.4.70.0030.03612.02
5.4.60.0050.03512.03
5.4.50.0070.03312.02
5.4.40.0050.03512.02
5.4.30.0050.04012.01
5.4.20.0090.04512.01
5.4.10.0040.03612.01
5.4.00.0030.03911.49
5.3.290.0050.04112.80
5.3.280.0060.03712.71
5.3.270.0040.04012.73
5.3.260.0060.03812.72
5.3.250.0050.03712.72
5.3.240.0040.03812.72
5.3.230.0070.03612.71
5.3.220.0050.03812.68
5.3.210.0070.03812.68
5.3.200.0080.03412.68
5.3.190.0080.03612.68
5.3.180.0040.03812.67
5.3.170.0130.03112.66
5.3.160.0060.03912.67
5.3.150.0050.03812.68
5.3.140.0050.03712.66
5.3.130.0070.03712.66
5.3.120.0060.03812.66
5.3.110.0060.04312.66
5.3.100.0090.03512.13
5.3.90.0060.03612.11
5.3.80.0040.03912.11
5.3.70.0060.03812.11
5.3.60.0080.04412.09
5.3.50.0040.04312.04
5.3.40.0070.03512.04
5.3.30.0070.03312.00
5.3.20.0050.03611.79
5.3.10.0070.03311.75
5.3.00.0040.03811.73
5.2.170.0030.0329.23
5.2.160.0050.0299.23
5.2.150.0050.0359.23
5.2.140.0050.0299.22
5.2.130.0010.0329.18
5.2.120.0070.0269.18
5.2.110.0050.0289.19
5.2.100.0060.0279.18
5.2.90.0090.0249.18
5.2.80.0070.0289.18
5.2.70.0050.0299.18
5.2.60.0030.0319.13
5.2.50.0040.0319.10
5.2.40.0050.0289.07
5.2.30.0070.0289.06
5.2.20.0030.0319.05
5.2.10.0060.0268.95
5.2.00.0040.0288.82
5.1.60.0060.0218.09
5.1.50.0040.0268.09
5.1.40.0030.0258.07
5.1.30.0020.0288.42
5.1.20.0040.0328.45
5.1.10.0020.0298.16
5.1.00.0040.0258.16
5.0.50.0050.0196.65
5.0.40.0040.0186.51
5.0.30.0050.0296.32
5.0.20.0030.0206.29
5.0.10.0070.0176.27
5.0.00.0050.0296.26
4.4.90.0040.0144.78
4.4.80.0000.0184.75
4.4.70.0020.0164.76
4.4.60.0050.0134.75
4.4.50.0020.0164.77
4.4.40.0060.0224.71
4.4.30.0040.0144.76
4.4.20.0030.0164.85
4.4.10.0040.0154.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0030.0144.67
4.3.90.0030.0144.63
4.3.80.0040.0234.58
4.3.70.0020.0154.63
4.3.60.0010.0164.63
4.3.50.0030.0154.63
4.3.40.0030.0244.54
4.3.30.0020.0163.30
4.3.20.0010.0173.29
4.3.10.0010.0163.24
4.3.00.0030.01016.71

preferences:
40.96 ms | 401 KiB | 5 Q