3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict=1); 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.0070.01016.63
8.3.50.0110.00821.96
8.3.40.0060.00918.97
8.3.30.0140.00718.85
8.3.20.0070.00020.16
8.3.10.0040.00423.37
8.3.00.0040.00419.98
8.2.180.0090.00918.54
8.2.170.0060.00922.96
8.2.160.0070.01020.35
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00319.03
8.2.120.0040.00426.35
8.2.110.0070.00321.05
8.2.100.0000.01117.78
8.2.90.0090.00017.97
8.2.80.0000.00917.97
8.2.70.0030.00617.59
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0030.00522.15
8.2.30.0070.00020.68
8.2.20.0000.00717.60
8.2.10.0050.00318.02
8.2.00.0080.00018.12
8.1.280.0040.01225.92
8.1.270.0000.00820.42
8.1.260.0050.00228.09
8.1.250.0040.00428.09
8.1.240.0030.00722.61
8.1.230.0040.00721.05
8.1.220.0000.00817.74
8.1.210.0030.00518.98
8.1.200.0030.00717.35
8.1.190.0050.00317.23
8.1.180.0000.00718.10
8.1.170.0040.00418.64
8.1.160.0000.00720.78
8.1.150.0040.00418.94
8.1.140.0030.00619.58
8.1.130.0040.00417.63
8.1.120.0000.00717.54
8.1.110.0030.00617.48
8.1.100.0000.00717.47
8.1.90.0000.00717.50
8.1.80.0000.00817.45
8.1.70.0040.00417.43
8.1.60.0000.00717.60
8.1.50.0000.00817.43
8.1.40.0030.00617.41
8.1.30.0000.00817.54
8.1.20.0000.00817.63
8.1.10.0040.00417.59
8.1.00.0000.00817.49
8.0.300.0050.00220.08
8.0.290.0040.00416.88
8.0.280.0030.00318.46
8.0.270.0000.00717.23
8.0.260.0030.00317.30
8.0.250.0060.00016.98
8.0.240.0000.00717.03
8.0.230.0100.00017.09
8.0.220.0000.00716.95
8.0.210.0050.00316.95
8.0.200.0060.00317.07
8.0.190.0000.01016.93
8.0.180.0040.00416.87
8.0.170.0080.00016.87
8.0.160.0030.00416.87
8.0.150.0070.00016.79
8.0.140.0040.00416.96
8.0.130.0050.00013.34
8.0.120.0040.00416.83
8.0.110.0040.00416.95
8.0.100.0000.00816.82
8.0.90.0040.00416.97
8.0.80.0150.00716.97
8.0.70.0050.00216.96
8.0.60.0080.00016.82
8.0.50.0000.00716.83
8.0.30.0110.00816.96
8.0.20.0120.00717.40
8.0.10.0040.00416.96
8.0.00.0110.00816.86
7.4.330.0020.00216.84
7.4.320.0060.00016.61
7.4.300.0000.00616.62
7.4.290.0030.00316.46
7.4.280.0040.00416.56
7.4.270.0070.00016.57
7.4.260.0000.00716.50
7.4.250.0040.00416.42
7.4.240.0030.00416.51
7.4.230.0030.00316.71
7.4.220.0070.01416.49
7.4.210.0140.00016.54
7.4.200.0000.00716.68
7.4.160.0150.00016.48
7.4.150.0120.01217.40
7.4.140.0170.00617.86
7.4.130.0070.01216.51
7.4.120.0100.00716.62
7.4.110.0070.01016.54
7.4.100.0070.01416.39
7.4.90.0100.00716.42
7.4.80.0130.00319.39
7.4.70.0080.00816.66
7.4.60.0030.01316.48
7.4.50.0110.00416.50
7.4.40.0130.00316.44
7.4.30.0060.01216.53
7.4.00.0060.01015.21
7.3.330.0050.00013.24
7.3.320.0030.00313.38
7.3.310.0030.00316.22
7.3.300.0000.00716.43
7.3.290.0090.00716.36
7.3.280.0070.01116.34
7.3.270.0130.00317.40
7.3.260.0120.00616.59
7.3.250.0160.00516.39
7.3.240.0130.00716.35
7.3.230.0090.00916.44
7.3.210.0130.00416.41
7.3.200.0070.01116.59
7.3.190.0100.00716.29
7.3.180.0100.00716.54
7.3.170.0130.01016.30
7.3.160.0110.00616.45
7.2.330.0170.00016.78
7.2.320.0040.01216.40
7.2.310.0100.00616.71
7.2.300.0060.01116.43
7.2.290.0060.01216.77
7.2.60.0090.00616.80
7.2.00.0000.01219.29
7.1.200.0090.00315.63
7.1.100.0000.01418.04
7.1.70.0030.00717.02
7.1.60.0190.00619.44
7.1.50.0090.01516.93
7.1.00.0170.06322.32
7.0.200.0000.01016.73
7.0.60.0030.04019.91
7.0.50.0000.05317.92
7.0.40.0130.06720.24
7.0.30.0470.07020.23
7.0.20.0330.07720.06
7.0.10.0100.05320.30
7.0.00.0000.05020.10
5.6.280.0070.05020.79
5.6.210.0030.05720.50
5.6.200.0070.05718.25
5.6.190.0100.08320.55
5.6.180.0200.08020.77
5.6.170.0170.04020.39
5.6.160.0030.09020.48
5.6.150.0070.08318.29
5.6.140.0030.04718.28
5.6.130.0070.07318.18
5.6.120.0100.08020.98
5.6.110.0000.08021.03
5.6.100.0070.08021.05
5.6.90.0030.09021.12
5.6.80.0170.07720.39
5.5.350.0070.08320.45
5.5.340.0070.04018.00
5.5.330.0100.04020.19
5.5.320.0470.04720.36
5.5.310.0200.03720.46
5.5.300.0100.07717.93
5.5.290.0100.04017.98
5.5.280.0070.03720.90
5.5.270.0130.03720.65
5.5.260.0070.06320.81
5.5.250.0070.06720.63
5.5.240.4270.03720.23

preferences:
46.66 ms | 401 KiB | 5 Q