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 B; $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.0100.01016.63
8.3.50.0170.00222.07
8.3.40.0110.00718.78
8.3.30.0100.00318.68
8.3.20.0070.00020.30
8.3.10.0080.00023.56
8.3.00.0040.00419.73
8.2.180.0090.00918.41
8.2.170.0130.00622.96
8.2.160.0100.00320.36
8.2.150.0160.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00419.23
8.2.120.0090.00026.35
8.2.110.0030.00620.35
8.2.100.0090.00317.80
8.2.90.0050.00319.25
8.2.80.0060.00317.97
8.2.70.0060.00317.50
8.2.60.0050.00317.80
8.2.50.0040.00418.07
8.2.40.0050.00322.01
8.2.30.0040.00420.54
8.2.20.0080.00017.75
8.2.10.0040.00418.03
8.2.00.0060.00318.00
8.1.280.0070.01025.92
8.1.270.0030.00620.16
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00023.97
8.1.230.0000.01117.70
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0040.00418.50
8.1.160.0000.00720.70
8.1.150.0000.00718.83
8.1.140.0040.00419.48
8.1.130.0080.00017.52
8.1.120.0070.00017.44
8.1.110.0030.00517.33
8.1.100.0000.00717.41
8.1.90.0030.00517.27
8.1.80.0040.00417.34
8.1.70.0000.00717.19
8.1.60.0080.00017.46
8.1.50.0080.00017.51
8.1.40.0070.00017.55
8.1.30.0030.00517.59
8.1.20.0090.00017.64
8.1.10.0000.00817.47
8.1.00.0090.00017.52
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.25
8.0.270.0000.00717.13
8.0.260.0060.00017.18
8.0.250.0070.00016.97
8.0.240.0000.00616.93
8.0.230.0050.00516.92
8.0.220.0000.00716.79
8.0.210.0050.00216.79
8.0.200.0080.00416.92
8.0.190.0070.00416.87
8.0.180.0000.00816.77
8.0.170.0070.00016.91
8.0.160.0040.00416.85
8.0.150.0030.00316.92
8.0.140.0050.00316.73
8.0.130.0000.00513.31
8.0.120.0050.00316.75
8.0.110.0000.00716.80
8.0.100.0040.00416.86
8.0.90.0070.00016.67
8.0.80.0070.02216.78
8.0.70.0080.00016.91
8.0.60.0000.00816.77
8.0.50.0000.00716.94
8.0.30.0120.00816.81
8.0.20.0130.00617.43
8.0.10.0040.00417.06
8.0.00.0130.00416.76
7.4.330.0030.00316.83
7.4.320.0040.00416.57
7.4.300.0000.01016.49
7.4.290.0030.00316.59
7.4.280.0000.00816.64
7.4.270.0070.00016.41
7.4.260.0070.00016.52
7.4.250.0090.00016.47
7.4.240.0060.00216.63
7.4.230.0000.00716.58
7.4.220.0150.00316.45
7.4.210.0090.00616.55
7.4.200.0030.00316.42
7.4.160.0060.01016.52
7.4.150.0080.00817.40
7.4.140.0120.00617.86
7.4.130.0060.01516.52
7.4.120.0080.01016.63
7.4.110.0070.01016.44
7.4.100.0140.00716.36
7.4.90.0130.01016.59
7.4.80.0100.00619.39
7.4.70.0080.01216.61
7.4.60.0100.00616.70
7.4.50.0140.00316.49
7.4.40.0110.01116.41
7.4.30.0120.00916.45
7.4.00.0150.00015.01
7.3.330.0020.00213.37
7.3.320.0000.00613.34
7.3.310.0000.00716.26
7.3.300.0040.00416.42
7.3.290.0110.00416.32
7.3.280.0080.00916.39
7.3.270.0090.00817.40
7.3.260.0140.00816.53
7.3.250.0140.00716.49
7.3.240.0120.00616.47
7.3.230.0140.00316.41
7.3.210.0100.00716.28
7.3.200.0150.00616.19
7.3.190.0120.01216.13
7.3.180.0120.00316.32
7.3.170.0090.00916.34
7.3.160.0140.00316.55
7.2.330.0120.00616.75
7.2.320.0070.01116.62
7.2.310.0030.01316.33
7.2.300.0120.00616.67
7.2.290.0030.01316.55
7.2.60.0000.01516.36
7.2.00.0040.00819.47
7.1.200.0060.01015.62
7.1.100.0070.00718.30
7.1.70.0000.00717.16
7.1.60.0070.01719.44
7.1.50.0100.01416.90
7.1.00.0070.07022.45
7.0.200.0050.00216.79
7.0.60.0030.04319.86
7.0.50.0100.07017.84
7.0.40.0100.08320.18
7.0.30.0200.04320.34
7.0.20.0270.05020.24
7.0.10.0100.06720.16
7.0.00.0170.07320.23
5.6.280.0070.05720.82
5.6.210.0100.07320.63
5.6.200.0070.07718.28
5.6.190.0100.06720.52
5.6.180.0200.08720.41
5.6.170.0230.03320.47
5.6.160.0230.06720.71
5.6.150.0030.04318.15
5.6.140.0070.08018.28
5.6.130.0170.07718.28
5.6.120.0130.06320.98
5.6.110.0070.07321.11
5.6.100.0230.06021.10
5.6.90.0130.07721.04
5.6.80.0100.06720.50
5.5.350.0130.04020.39
5.5.340.0170.06718.09
5.5.330.0100.06020.32
5.5.320.0600.07020.42
5.5.310.0200.08320.30
5.5.300.0070.04017.98
5.5.290.0070.05318.01
5.5.280.0030.04320.82
5.5.270.0000.07320.86
5.5.260.0000.08720.88
5.5.250.0100.06320.60
5.5.240.4130.04320.20

preferences:
78.37 ms | 401 KiB | 5 Q