3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function foo() { echo "I R private::A called in class ".get_class()."\n"; } public function rebind(Closure $fn) { //$fn = $this->getClosure(); $fn2 = $fn->call($this); $fn2(); } public function getClosure() { $fn = function() { $this->foo();}; return $fn; } } class B extends A { private function foo() { echo "I R private::B called in class ".get_class()."\n"; } public function getClosure() { $fn = function() { $this->foo();}; return $fn; } } $b = new B(); $fn = $b->getClosure(); $a = new A(); $a->rebind($fn);

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.50
8.3.50.0110.00922.12
8.3.40.0140.00018.82
8.3.30.0040.01118.72
8.3.20.0040.00420.21
8.3.10.0030.00523.51
8.3.00.0050.00319.79
8.2.180.0070.01416.88
8.2.170.0110.01122.96
8.2.160.0100.00320.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00419.40
8.2.120.0040.00426.35
8.2.110.0030.00719.22
8.2.100.0110.00018.03
8.2.90.0040.00419.26
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0000.00917.80
8.2.50.0040.00418.07
8.2.40.0040.00422.33
8.2.30.0040.00420.61
8.2.20.0000.00817.74
8.2.10.0050.00318.15
8.2.00.0050.00218.11
8.1.280.0070.00725.92
8.1.270.0040.00420.18
8.1.260.0050.00328.09
8.1.250.0080.00028.09
8.1.240.0060.00321.22
8.1.230.0110.00417.42
8.1.220.0000.00917.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0030.00617.35
8.1.180.0060.00318.10
8.1.170.0040.00418.46
8.1.160.0070.00020.73
8.1.150.0060.00318.81
8.1.140.0050.00319.58
8.1.130.0000.00817.77
8.1.120.0000.00717.40
8.1.110.0050.00317.36
8.1.100.0040.00417.40
8.1.90.0080.00017.47
8.1.80.0030.00517.50
8.1.70.0000.00717.38
8.1.60.0000.00817.52
8.1.50.0040.00417.49
8.1.40.0060.00317.53
8.1.30.0040.00417.68
8.1.20.0050.00217.64
8.1.10.0080.00017.60
8.1.00.0040.00417.50
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.48
8.0.270.0040.00417.27
8.0.260.0000.00817.18
8.0.250.0030.00316.93
8.0.240.0030.00317.05
8.0.230.0060.00317.04
8.0.220.0030.00316.83
8.0.210.0000.00716.98
8.0.200.0070.00017.02
8.0.190.0030.00816.94
8.0.180.0000.00716.95
8.0.170.0040.00416.89
8.0.160.0070.00016.93
8.0.150.0000.00816.80
8.0.140.0000.00916.95
8.0.130.0050.00013.40
8.0.120.0030.00516.82
8.0.110.0070.00016.81
8.0.100.0040.00416.83
8.0.90.0050.00216.96
8.0.80.0060.01017.02
8.0.70.0000.00716.84
8.0.60.0000.00816.75
8.0.50.0050.00317.00
8.0.30.0120.00617.20
8.0.20.0070.01217.40
8.0.10.0040.00416.96
8.0.00.0120.00516.92
7.4.330.0030.00316.88
7.4.320.0030.00316.51
7.4.300.0000.00616.66
7.4.290.0070.00016.52
7.4.280.0040.00416.62
7.4.270.0000.00716.68
7.4.260.0030.00316.61
7.4.250.0050.00316.46
7.4.240.0030.00316.58
7.4.230.0030.00316.43
7.4.220.0120.00616.46
7.4.210.0060.00916.70
7.4.200.0030.00316.41
7.4.160.0120.00416.56
7.4.150.0110.00617.40
7.4.140.0090.00917.86
7.4.130.0080.01016.49
7.4.120.0080.01016.68
7.4.110.0110.00716.51
7.4.100.0130.01016.52
7.4.90.0090.00916.37
7.4.80.0150.00319.39
7.4.70.0030.01816.54
7.4.60.0090.00616.52
7.4.50.0090.00616.31
7.4.40.0030.01216.55
7.4.30.0100.00716.72
7.4.00.0110.00414.80
7.3.330.0000.00513.38
7.3.320.0060.00013.36
7.3.310.0000.00716.39
7.3.300.0000.00716.38
7.3.290.0050.00916.36
7.3.280.0100.00616.35
7.3.270.0030.01317.40
7.3.260.0140.00316.53
7.3.250.0130.00916.45
7.3.240.0090.00816.53
7.3.230.0030.01416.61
7.3.210.0070.01716.53
7.3.200.0090.00916.34
7.3.190.0060.01216.52
7.3.180.0060.01216.42
7.3.170.0090.00916.39
7.3.160.0110.00616.49
7.2.330.0090.00916.83
7.2.320.0100.00716.68
7.2.310.0130.00316.68
7.2.300.0030.01416.44
7.2.290.0030.01316.78
7.2.60.0070.00716.92
7.2.00.0070.00319.33
7.1.200.0060.00615.84
7.1.100.0030.01018.21
7.1.70.0030.00516.95
7.1.60.0120.01219.44
7.1.50.0070.01616.63
7.1.00.0070.07322.33
7.0.200.0030.00716.88
7.0.60.0130.08020.02
7.0.50.0100.07317.88
7.0.40.0130.07720.40
7.0.30.0270.05720.14
7.0.20.0230.08320.16
7.0.10.0030.06320.24
7.0.00.0030.04720.07
5.6.280.0030.03020.80
5.6.210.0000.09020.74
5.6.200.0130.03318.29
5.6.190.0070.05720.55
5.6.180.0230.08020.64
5.6.170.0130.04320.52
5.6.160.0130.08320.47
5.6.150.0030.03718.18
5.6.140.0070.05318.15
5.6.130.0130.07718.14
5.6.120.0030.07320.91
5.6.110.0100.05721.00
5.6.100.0130.05021.00
5.6.90.0070.06021.14
5.6.80.0130.07020.39
5.5.350.0200.07320.48
5.5.340.0170.07317.96
5.5.330.0000.04720.27
5.5.320.0530.05020.20
5.5.310.0200.04320.29
5.5.300.0070.08017.93
5.5.290.0070.08718.05
5.5.280.0130.08020.70
5.5.270.0130.06320.89
5.5.260.0030.08720.78
5.5.250.0000.07020.64
5.5.240.4200.03720.20

preferences:
50.51 ms | 401 KiB | 5 Q