3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function foo(int $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("Hello"); $bFN = $this->getClosure("Hello"); $cFN = $c->getClosure("Hello"); $aFN(); $cFN(); } } class C extends B { public function foo(bool $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.0160.00316.75
8.3.50.0140.00522.12
8.3.40.0140.00318.97
8.3.30.0040.01118.77
8.3.20.0070.00020.30
8.3.10.0040.00423.61
8.3.00.0080.00019.96
8.2.180.0090.00618.29
8.2.170.0090.00922.96
8.2.160.0030.01020.29
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0060.00319.30
8.2.120.0080.00026.35
8.2.110.0080.00022.26
8.2.100.0080.00418.04
8.2.90.0040.00419.05
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0080.00017.80
8.2.50.0000.00818.07
8.2.40.0040.00422.34
8.2.30.0000.00720.53
8.2.20.0030.00517.75
8.2.10.0070.00018.01
8.2.00.0040.00418.07
8.1.280.0100.00725.92
8.1.270.0030.00620.14
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0040.00423.92
8.1.230.0050.00517.83
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0060.00317.23
8.1.180.0000.00818.10
8.1.170.0000.00818.57
8.1.160.0000.00720.63
8.1.150.0070.00018.95
8.1.140.0000.00819.60
8.1.130.0000.00717.64
8.1.120.0000.00717.45
8.1.110.0060.00317.39
8.1.100.0050.00317.46
8.1.90.0000.00817.46
8.1.80.0030.00517.54
8.1.70.0000.00717.40
8.1.60.0040.00417.64
8.1.50.0040.00417.58
8.1.40.0030.00517.58
8.1.30.0060.00317.61
8.1.20.0030.00617.54
8.1.10.0040.00417.59
8.1.00.0040.00417.40
8.0.300.0050.00318.77
8.0.290.0070.00016.75
8.0.280.0050.00218.39
8.0.270.0000.00717.28
8.0.260.0030.00317.31
8.0.250.0030.00316.93
8.0.240.0080.00017.07
8.0.230.0040.00417.04
8.0.220.0000.00716.98
8.0.210.0040.00416.86
8.0.200.0120.00316.86
8.0.190.0000.00917.04
8.0.180.0040.00417.00
8.0.170.0000.00816.95
8.0.160.0080.00017.07
8.0.150.0070.00016.90
8.0.140.0000.00716.87
8.0.130.0030.00313.38
8.0.120.0090.00016.82
8.0.110.0040.00416.98
8.0.100.0070.00017.00
8.0.90.0080.00017.02
8.0.80.0150.00616.98
8.0.70.0070.00017.03
8.0.60.0040.00416.91
8.0.50.0070.00016.98
8.0.30.0120.00617.23
8.0.20.0120.00817.40
8.0.10.0070.00017.12
8.0.00.0120.00716.81
7.4.330.0000.00516.76
7.4.320.0000.00616.61
7.4.300.0050.00416.59
7.4.290.0070.00016.65
7.4.280.0040.00416.56
7.4.270.0030.00316.62
7.4.260.0050.00216.45
7.4.250.0080.00016.38
7.4.240.0050.00216.45
7.4.230.0000.00816.68
7.4.220.0140.00316.68
7.4.210.0070.00716.49
7.4.200.0000.00716.34
7.4.160.0090.00916.52
7.4.150.0030.01617.40
7.4.140.0100.01017.86
7.4.130.0080.01116.49
7.4.120.0130.00616.48
7.4.110.0070.01716.66
7.4.100.0170.00316.79
7.4.90.0130.00816.46
7.4.80.0120.00619.39
7.4.70.0140.00416.60
7.4.60.0150.00616.61
7.4.50.0040.01116.30
7.4.40.0070.01016.48
7.4.30.0170.00716.38
7.4.00.0090.00614.93
7.3.330.0000.00513.38
7.3.320.0060.00013.20
7.3.310.0000.00716.42
7.3.300.0040.00416.22
7.3.290.0070.00916.40
7.3.280.0070.01016.39
7.3.270.0110.01217.40
7.3.260.0110.01116.62
7.3.250.0100.01216.41
7.3.240.0080.01116.44
7.3.230.0110.00716.50
7.3.210.0100.00716.46
7.3.200.0100.01016.49
7.3.190.0070.01416.49
7.3.180.0060.00916.30
7.3.170.0090.00916.52
7.3.160.0150.00316.45
7.2.330.0100.01016.66
7.2.320.0110.01116.64
7.2.310.0130.00316.63
7.2.300.0090.00916.41
7.2.290.0140.00316.38
7.2.60.0130.00316.64
7.2.00.0100.00719.58
7.1.200.0040.01215.84
7.1.100.0070.01418.30
7.1.70.0040.00417.20
7.1.60.0140.01119.44
7.1.50.0090.00916.70
7.1.00.0130.06722.40
7.0.200.0080.00016.79
7.0.60.0130.08020.07
7.0.50.0000.09317.88
7.0.40.0200.04720.11
7.0.30.0470.07320.26
7.0.20.0230.08020.22
7.0.10.0100.08320.16
7.0.00.0030.04720.06
5.6.280.0000.03320.79
5.6.210.0170.07320.76
5.6.200.0070.08718.19
5.6.190.0100.08020.53
5.6.180.0130.06020.44
5.6.170.0170.04020.58
5.6.160.0100.06020.51
5.6.150.0070.03318.25
5.6.140.0070.07718.21
5.6.130.0130.07718.16
5.6.120.0070.08721.02
5.6.110.0270.07021.11
5.6.100.0170.07321.15
5.6.90.0370.05721.14
5.6.80.0000.07720.52
5.5.350.0170.08020.32
5.5.340.0070.04718.07
5.5.330.0100.08720.57
5.5.320.0600.06720.31
5.5.310.0170.04020.29
5.5.300.0100.08018.04
5.5.290.0070.07018.02
5.5.280.0130.07720.82
5.5.270.0030.05020.89
5.5.260.0130.05720.66
5.5.250.0200.05020.70
5.5.240.3830.04020.28

preferences:
42.57 ms | 401 KiB | 5 Q