3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function foo(float $bar) { echo "This is private"; } public function getClosure($bar) { return function () use ($bar) { $this->foo($bar); }; } } class B extends A { public function test(A $a, C $c) { $aFN = $a->getClosure(42.5); $bFN = $this->getClosure(42.5); $cFN = $c->getClosure(42.5); $aFN(); $bFN(); $cFN(); } } class C extends B { public function foo(int $bar) { echo "This is public"; } public function getClosure($bar) { return function () use ($bar) { $this->foo($bar); }; } } $a = new A; $c = new c; $obj = new B(); $obj->test($a, $c);

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.00716.63
8.3.50.0100.00921.99
8.3.40.0120.00818.94
8.3.30.0070.00718.90
8.3.20.0040.00420.38
8.3.10.0040.00423.64
8.3.00.0080.00019.97
8.2.180.0090.00618.54
8.2.170.0070.01122.96
8.2.160.0070.00720.39
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0060.00319.29
8.2.120.0080.00026.35
8.2.110.0060.00320.53
8.2.100.0030.00917.80
8.2.90.0000.00919.27
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0040.00418.05
8.2.50.0050.00318.07
8.2.40.0040.00422.40
8.2.30.0000.00720.66
8.2.20.0080.00017.64
8.2.10.0040.00417.95
8.2.00.0040.00418.01
8.1.280.0090.00625.92
8.1.270.0040.00420.39
8.1.260.0070.00028.09
8.1.250.0000.00728.09
8.1.240.0090.00023.83
8.1.230.0050.00717.83
8.1.220.0050.00317.76
8.1.210.0050.00318.77
8.1.200.0070.00417.22
8.1.190.0030.00517.23
8.1.180.0070.00018.10
8.1.170.0040.00418.34
8.1.160.0000.00720.63
8.1.150.0000.00718.84
8.1.140.0040.00419.59
8.1.130.0000.00717.59
8.1.120.0040.00417.53
8.1.110.0080.00017.48
8.1.100.0040.00417.48
8.1.90.0050.00317.54
8.1.80.0000.00717.43
8.1.70.0030.00317.45
8.1.60.0000.00717.62
8.1.50.0030.00517.52
8.1.40.0040.00417.57
8.1.30.0040.00417.70
8.1.20.0030.00517.53
8.1.10.0000.00817.60
8.1.00.0040.00417.59
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0030.00318.50
8.0.270.0000.00717.28
8.0.260.0060.00017.18
8.0.250.0030.00317.01
8.0.240.0030.00317.08
8.0.230.0050.00216.99
8.0.220.0070.00016.95
8.0.210.0000.00717.00
8.0.200.0040.00417.00
8.0.190.0030.00616.93
8.0.180.0030.00317.05
8.0.170.0000.00817.01
8.0.160.0050.00316.84
8.0.150.0050.00316.94
8.0.140.0070.00016.91
8.0.130.0000.00613.36
8.0.120.0040.00416.82
8.0.110.0040.00416.81
8.0.100.0000.00816.95
8.0.90.0050.00217.02
8.0.80.0100.00716.85
8.0.70.0030.00517.08
8.0.60.0040.00416.83
8.0.50.0000.00816.75
8.0.30.0140.00517.08
8.0.20.0080.01117.40
8.0.10.0080.00017.04
8.0.00.0060.01116.83
7.4.330.0020.00316.79
7.4.320.0000.00616.48
7.4.300.0060.00016.63
7.4.290.0000.00716.59
7.4.280.0050.00316.39
7.4.270.0030.00316.51
7.4.260.0070.00016.58
7.4.250.0000.00816.50
7.4.240.0000.00716.45
7.4.230.0030.00316.42
7.4.220.0070.01016.64
7.4.210.0120.00316.46
7.4.200.0080.00016.50
7.4.160.0090.00616.53
7.4.150.0080.00917.40
7.4.140.0080.01317.86
7.4.130.0120.00816.37
7.4.120.0100.01116.54
7.4.110.0060.01216.58
7.4.100.0140.00316.57
7.4.90.0030.01416.50
7.4.80.0070.01019.39
7.4.70.0030.01316.42
7.4.60.0090.01216.47
7.4.50.0100.00316.32
7.4.40.0090.00616.46
7.4.30.0130.00916.44
7.4.00.0070.01015.02
7.3.330.0060.00013.38
7.3.320.0030.00313.32
7.3.310.0050.00216.37
7.3.300.0000.00816.25
7.3.290.0050.01016.29
7.3.280.0090.00616.31
7.3.270.0130.00317.40
7.3.260.0060.01216.42
7.3.250.0110.00916.44
7.3.240.0100.00916.27
7.3.230.0110.00616.39
7.3.210.0080.00816.46
7.3.200.0130.00716.32
7.3.190.0160.00016.23
7.3.180.0130.00716.37
7.3.170.0100.00716.37
7.3.160.0130.00316.26
7.2.330.0040.01316.72
7.2.320.0000.01716.78
7.2.310.0030.01216.90
7.2.300.0060.01216.71
7.2.290.0120.00616.88
7.2.60.0110.00416.89
7.2.00.0030.01219.60
7.1.200.0040.01115.80
7.1.100.0070.00718.33
7.1.70.0040.00416.93
7.1.60.0170.00719.44
7.1.50.0100.01417.02
7.1.00.0000.08022.45
7.0.200.0080.00016.63
7.0.60.0130.07019.84
7.0.50.0070.05317.85
7.0.40.0100.07720.24
7.0.30.0470.07320.30
7.0.20.0300.05320.15
7.0.10.0170.07720.09
7.0.00.0100.08720.09
5.6.280.0030.03021.17
5.6.210.0030.06720.66
5.6.200.0070.08718.27
5.6.190.0000.08320.58
5.6.180.0200.06020.52
5.6.170.0170.04020.43
5.6.160.0170.07020.50
5.6.150.0070.04318.27
5.6.140.0030.08018.24
5.6.130.0100.08018.27
5.6.120.0070.09021.00
5.6.110.0100.07021.09
5.6.100.0170.05721.15
5.6.90.0070.08721.15
5.6.80.0070.06720.41
5.5.350.0100.08320.39
5.5.340.0030.08317.98
5.5.330.0030.05020.30
5.5.320.0700.04720.27
5.5.310.0170.05720.38
5.5.300.0070.05018.07
5.5.290.0100.08717.97
5.5.280.0100.08020.89
5.5.270.0030.04320.88
5.5.260.0130.07720.91
5.5.250.0070.05320.71
5.5.240.3500.04020.18

preferences:
45.23 ms | 401 KiB | 5 Q