3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function testPrivate (bool $str) { echo "Class A\n"; } public function test() { $this->testPrivate(true); } function getClosure() { return function() use ($foo) { return $this->testPrivate($foo); }; } } class B extends A { private function testPrivate (string $value) { echo "Class B\n"; } function getClosure($foo) { return function() use ($foo) { return $this->testPrivate($foo); }; } } $a = new A(); $b = new B(); $fn = $b->getClosure(true); $fn2 = $fn->bindTo($a); $fn2();

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.0130.00616.50
8.3.50.0070.00717.98
8.3.40.0070.01118.66
8.3.30.0070.00718.38
8.3.20.0040.00420.34
8.3.10.0080.00021.95
8.3.00.0000.00819.72
8.2.180.0170.00318.16
8.2.170.0130.00622.96
8.2.160.0130.00720.35
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0060.00319.15
8.2.120.0060.00326.35
8.2.110.0070.00421.11
8.2.100.0070.00417.80
8.2.90.0040.00419.15
8.2.80.0080.00017.97
8.2.70.0040.00417.35
8.2.60.0070.00017.80
8.2.50.0040.00418.07
8.2.40.0040.00422.23
8.2.30.0040.00420.50
8.2.20.0050.00217.61
8.2.10.0000.00817.98
8.2.00.0040.00417.80
8.1.280.0100.00725.92
8.1.270.0030.00520.16
8.1.260.0040.00428.09
8.1.250.0050.00228.09
8.1.240.0060.00321.12
8.1.230.0040.00817.42
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0090.00017.22
8.1.190.0000.00817.10
8.1.180.0080.00018.10
8.1.170.0040.00418.53
8.1.160.0000.00820.55
8.1.150.0040.00418.64
8.1.140.0030.00519.45
8.1.130.0030.00317.63
8.1.120.0000.00717.24
8.1.110.0000.00717.22
8.1.100.0000.00817.27
8.1.90.0000.00817.37
8.1.80.0030.00317.31
8.1.70.0000.00717.27
8.1.60.0070.00017.43
8.1.50.0040.00417.40
8.1.40.0060.00317.37
8.1.30.0030.00517.36
8.1.20.0070.00017.56
8.1.10.0050.00317.46
8.1.00.0000.00717.30
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0030.00318.32
8.0.270.0070.00017.13
8.0.260.0000.00617.04
8.0.250.0030.00316.79
8.0.240.0000.00816.78
8.0.230.0040.00416.77
8.0.220.0030.00316.66
8.0.210.0040.00416.76
8.0.200.0000.00716.79
8.0.190.0070.00416.91
8.0.180.0080.00016.75
8.0.170.0040.00416.77
8.0.160.0030.00616.86
8.0.150.0030.00316.84
8.0.140.0050.00216.68
8.0.130.0030.00313.24
8.0.120.0050.00316.78
8.0.110.0040.00416.77
8.0.100.0070.00016.87
8.0.90.0030.00316.87
8.0.80.0100.00716.80
8.0.70.0000.00716.89
8.0.60.0040.00416.74
8.0.50.0000.00716.89
8.0.30.0060.01216.82
8.0.20.0090.00917.40
8.0.10.0000.00716.91
8.0.00.0090.00916.62
7.4.330.0000.00516.69
7.4.320.0000.00716.61
7.4.300.0090.00016.41
7.4.290.0030.00316.60
7.4.280.0000.00716.59
7.4.270.0060.00316.57
7.4.260.0000.00716.49
7.4.250.0070.00016.37
7.4.240.0000.00716.46
7.4.230.0050.00216.34
7.4.220.0090.00916.64
7.4.210.0090.00616.45
7.4.200.0030.00316.51
7.4.160.0090.00616.62
7.4.150.0090.00917.40
7.4.140.0120.00717.86
7.4.130.0090.00916.48
7.4.120.0070.01016.60
7.4.110.0060.01216.50
7.4.100.0090.00916.35
7.4.90.0110.00616.35
7.4.80.0030.02019.39
7.4.70.0030.01316.44
7.4.60.0060.00916.62
7.4.50.0070.00716.55
7.4.40.0160.00016.34
7.4.30.0140.00716.69
7.4.00.0040.01214.84
7.3.330.0000.00513.14
7.3.320.0000.00513.34
7.3.310.0030.00316.23
7.3.300.0000.00616.29
7.3.290.0090.00516.34
7.3.280.0110.00816.40
7.3.270.0100.01017.40
7.3.260.0130.00316.38
7.3.250.0080.00916.49
7.3.240.0070.01016.53
7.3.230.0070.01016.52
7.3.210.0060.01116.45
7.3.200.0150.00316.44
7.3.190.0180.00016.28
7.3.180.0070.01016.35
7.3.170.0030.01416.48
7.3.160.0070.01016.52
7.3.120.0040.01314.86
7.3.110.0060.00714.92
7.3.100.0020.01114.88
7.3.90.0070.00614.85
7.3.80.0080.00614.77
7.3.70.0030.01014.81
7.3.60.0030.01014.79
7.3.50.0030.00914.70
7.3.40.0050.00814.77
7.3.30.0050.00514.74
7.3.20.0030.01016.39
7.3.10.0070.00616.50
7.3.00.0020.01016.66
7.2.330.0060.01216.77
7.2.320.0030.01316.62
7.2.310.0070.01316.64
7.2.300.0100.00616.43
7.2.290.0070.01616.64
7.2.240.0060.01115.24
7.2.230.0090.00914.94
7.2.220.0050.01015.03
7.2.210.0030.00915.06
7.2.200.0040.00915.05
7.2.190.0050.00715.07
7.2.180.0020.01215.02
7.2.170.0080.00614.88
7.2.160.0050.00814.98
7.2.150.0020.01216.84
7.2.140.0080.00516.86
7.2.130.0080.00617.00
7.2.120.0050.01116.97
7.2.110.0010.01316.76
7.2.100.0080.00816.67
7.2.90.0090.00716.89
7.2.80.0070.00516.70
7.2.70.0060.00716.93
7.2.60.0070.00716.98
7.2.50.0060.00916.98
7.2.40.0030.01016.88
7.2.30.0020.01016.75
7.2.20.0070.00916.77
7.2.10.0040.00716.91
7.2.00.0060.00617.80
7.1.330.0030.01015.84
7.1.320.0030.00815.90
7.1.310.0030.01215.94
7.1.300.0060.00815.92
7.1.290.0020.00815.82
7.1.280.0040.00715.87
7.1.270.0090.00415.81
7.1.260.0040.01015.94
7.1.250.0080.00615.64
7.1.200.0060.00615.75
7.1.100.0040.00718.25
7.1.70.0030.00517.22
7.1.60.0100.01419.44
7.1.50.0060.01917.11
7.1.00.0000.08022.36
7.0.200.0070.00016.63
7.0.60.0070.05019.90
7.0.50.0000.08317.81
7.0.40.0030.06020.25
7.0.30.0300.04720.25
7.0.20.0230.03720.09
7.0.10.0130.07720.10
7.0.00.0100.06720.06
5.6.280.0000.05721.02
5.6.210.0030.08020.64
5.6.200.0100.08018.20
5.6.190.0230.07020.54
5.6.180.0230.05020.77
5.6.170.0200.04720.52
5.6.160.0070.04320.47
5.6.150.0100.03318.18
5.6.140.0000.05718.27
5.6.130.0070.07718.34
5.6.120.0100.06321.14
5.6.110.0100.07720.98
5.6.100.0100.07321.10
5.6.90.0030.07720.99
5.6.80.0070.05020.37
5.5.350.0170.06720.44
5.5.340.0030.08317.95
5.5.330.0070.06720.27
5.5.320.0200.04320.35
5.5.310.0300.02720.32
5.5.300.0100.08017.96
5.5.290.0070.08718.07
5.5.280.0000.04720.76
5.5.270.0000.05020.81
5.5.260.0100.07720.97
5.5.250.0030.04320.48
5.5.240.4230.03320.09

preferences:
53.59 ms | 400 KiB | 5 Q