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(42); $bFN = $this->getClosure(42); $cFN = $c->getClosure(42); $aFN(); $bFN(); $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.0130.00616.75
8.3.50.0110.00418.00
8.3.40.0100.00718.57
8.3.30.0110.00418.79
8.3.20.0030.00520.16
8.3.10.0040.00423.66
8.3.00.0050.00319.97
8.2.180.0090.00618.53
8.2.170.0130.00722.96
8.2.160.0070.01020.31
8.2.150.0030.01224.18
8.2.140.0000.00824.66
8.2.130.0040.00419.38
8.2.120.0080.00026.35
8.2.110.0070.00320.35
8.2.100.0090.00317.93
8.2.90.0080.00019.07
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0080.00018.04
8.2.50.0090.00018.07
8.2.40.0030.00522.21
8.2.30.0070.00020.52
8.2.20.0080.00017.76
8.2.10.0040.00418.14
8.2.00.0000.00718.07
8.1.280.0120.00625.92
8.1.270.0080.00020.32
8.1.260.0000.00728.09
8.1.250.0080.00028.09
8.1.240.0060.00323.96
8.1.230.0040.00717.76
8.1.220.0030.00517.79
8.1.210.0080.00018.77
8.1.200.0000.01017.36
8.1.190.0080.00017.25
8.1.180.0040.00418.10
8.1.170.0000.00918.72
8.1.160.0070.00020.78
8.1.150.0000.00718.78
8.1.140.0050.00319.65
8.1.130.0030.00317.63
8.1.120.0040.00417.55
8.1.110.0060.00317.44
8.1.100.0040.00417.44
8.1.90.0080.00017.52
8.1.80.0040.00417.42
8.1.70.0000.00717.27
8.1.60.0030.00517.62
8.1.50.0050.00317.49
8.1.40.0030.00617.56
8.1.30.0040.00417.65
8.1.20.0040.00417.55
8.1.10.0040.00417.51
8.1.00.0070.00017.50
8.0.300.0000.00718.77
8.0.290.0070.00016.88
8.0.280.0000.00718.36
8.0.270.0030.00517.23
8.0.260.0000.00617.18
8.0.250.0070.00017.10
8.0.240.0070.00016.99
8.0.230.0060.00317.01
8.0.220.0070.00016.92
8.0.210.0070.00017.02
8.0.200.0100.00016.96
8.0.190.0090.00317.05
8.0.180.0000.00716.86
8.0.170.0000.00817.05
8.0.160.0040.00417.02
8.0.150.0000.00816.91
8.0.140.0040.00416.80
8.0.130.0000.00513.32
8.0.120.0050.00316.97
8.0.110.0080.00016.79
8.0.100.0070.00016.85
8.0.90.0040.00416.86
8.0.80.0110.01016.94
8.0.70.0040.00417.01
8.0.60.0030.00517.03
8.0.50.0070.00016.85
8.0.30.0170.00316.86
8.0.20.0110.00817.40
8.0.10.0000.00816.96
8.0.00.0120.00516.90
7.4.330.0000.00516.67
7.4.320.0000.00616.66
7.4.300.0040.00716.52
7.4.290.0030.00316.50
7.4.280.0040.00416.59
7.4.270.0000.00716.56
7.4.260.0070.00016.59
7.4.250.0040.00416.56
7.4.240.0030.00316.53
7.4.230.0050.00216.72
7.4.220.0120.00616.45
7.4.210.0110.00316.68
7.4.200.0000.00816.65
7.4.160.0080.00816.64
7.4.150.0070.01117.40
7.4.140.0110.00717.86
7.4.130.0130.00816.62
7.4.120.0010.01616.57
7.4.110.0180.00516.64
7.4.100.0100.01216.36
7.4.90.0090.01516.60
7.4.80.0110.00719.39
7.4.70.0090.00816.71
7.4.60.0140.00716.65
7.4.50.0070.00716.21
7.4.40.0090.00916.39
7.4.30.0090.00916.66
7.4.10.0100.01014.74
7.4.00.0100.00715.11
7.3.330.0030.00313.30
7.3.320.0050.00013.14
7.3.310.0030.00316.18
7.3.300.0070.00016.31
7.3.290.0040.01116.32
7.3.280.0050.01016.31
7.3.270.0140.00317.40
7.3.260.0060.01116.30
7.3.250.0070.01216.40
7.3.240.0090.01016.43
7.3.230.0060.01316.39
7.3.210.0070.01116.55
7.3.200.0070.01316.19
7.3.190.0070.01416.48
7.3.180.0100.00716.25
7.3.170.0130.00616.29
7.3.160.0100.00716.32
7.3.130.0100.00714.84
7.3.120.0100.00714.54
7.3.110.0060.01314.84
7.3.100.0000.01414.32
7.3.90.0070.00714.84
7.3.80.0060.00614.88
7.3.70.0040.01114.74
7.3.60.0100.00014.73
7.3.50.0030.01414.49
7.3.40.0000.01514.84
7.3.30.0030.01014.61
7.3.20.0040.01116.56
7.3.10.0040.00716.61
7.3.00.0030.00916.34
7.2.330.0120.00616.75
7.2.320.0070.01016.72
7.2.310.0000.01616.49
7.2.300.0030.01416.45
7.2.290.0040.01416.62
7.2.260.0120.00914.89
7.2.250.0130.00615.09
7.2.240.0030.01015.02
7.2.230.0040.01214.83
7.2.220.0030.01215.14
7.2.210.0000.01415.09
7.2.200.0000.01615.05
7.2.190.0000.01115.16
7.2.180.0070.01014.95
7.2.170.0030.01414.91
7.2.160.0040.00814.96
7.2.150.0070.01116.88
7.2.140.0040.00816.90
7.2.130.0030.01017.03
7.2.120.0100.00617.02
7.2.110.0180.00016.96
7.2.100.0000.00916.70
7.2.90.0080.01216.81
7.2.80.0100.00717.12
7.2.70.0120.00316.64
7.2.60.0070.00416.81
7.2.50.0030.01017.00
7.2.40.0030.01317.07
7.2.30.0000.01016.66
7.2.20.0040.01516.86
7.2.10.0100.00617.01
7.2.00.0040.00718.09
7.1.330.0070.00715.79
7.1.320.0030.01315.65
7.1.310.0060.01215.92
7.1.300.0030.00615.66
7.1.290.0030.00915.68
7.1.280.0000.01115.86
7.1.270.0040.01115.62
7.1.260.0000.01115.92
7.1.250.0090.00315.96
7.1.240.0030.00715.80
7.1.230.0090.00615.84
7.1.220.0000.01115.88
7.1.210.0080.00315.83
7.1.200.0060.00615.73
7.1.190.0000.00815.63
7.1.180.0030.00915.83
7.1.170.0040.01115.64
7.1.160.0050.00315.91
7.1.150.0060.00615.73
7.1.140.0030.01415.71
7.1.130.0030.01315.72
7.1.120.0030.00915.93
7.1.110.0030.00815.95
7.1.100.0020.01117.15
7.1.90.0110.00415.79
7.1.80.0100.00015.55
7.1.70.0020.00916.50
7.1.60.0090.01017.70
7.1.50.0120.00616.36
7.1.40.0070.00715.80
7.1.30.0100.00715.61
7.1.20.0000.01115.78
7.1.10.0060.00615.81
7.1.00.0050.04318.89
7.0.330.0060.00615.36
7.0.320.0030.01015.23
7.0.310.0030.00915.33
7.0.300.0030.01315.32
7.0.290.0080.00415.43
7.0.280.0040.00815.28
7.0.270.0070.00715.22
7.0.260.0040.00715.16
7.0.250.0100.00715.63
7.0.240.0000.01215.14
7.0.230.0070.00715.34
7.0.220.0000.00815.38
7.0.210.0110.00015.46
7.0.200.0050.00515.99
7.0.190.0060.00915.31
7.0.180.0120.00315.20
7.0.170.0060.00615.18
7.0.160.0050.00515.23
7.0.150.0030.00915.40
7.0.140.0050.00515.45
7.0.130.0030.00615.49
7.0.120.0040.00815.16
7.0.110.0100.00615.11
7.0.100.0070.00715.21
7.0.90.0060.00615.18
7.0.80.0030.00915.59
7.0.70.0040.00715.57
7.0.60.0040.02517.57
7.0.50.0020.03316.63
7.0.40.0060.02316.71
7.0.30.0270.03916.69
7.0.20.0180.04416.92
7.0.10.0080.04116.68
7.0.00.0050.04716.72
5.6.400.0000.01214.67
5.6.390.0060.00614.32
5.6.380.0060.00614.48
5.6.370.0070.00713.89
5.6.360.0030.00914.50
5.6.350.0100.00714.32
5.6.340.0070.01114.58
5.6.330.0070.01014.26
5.6.320.0050.00814.18
5.6.310.0060.00614.34
5.6.300.0090.00314.33
5.6.290.0140.00014.29
5.6.280.0020.02417.57
5.6.270.0060.00614.31
5.6.260.0080.00514.46
5.6.250.0040.01514.49
5.6.240.0060.01314.46
5.6.230.0060.00614.50
5.6.220.0040.01114.27
5.6.210.0020.02617.47
5.6.200.0060.04116.27
5.6.190.0050.02817.47
5.6.180.0130.04517.50
5.6.170.0150.04417.55
5.6.160.0050.04417.35
5.6.150.0080.02016.35
5.6.140.0100.03316.17
5.6.130.0140.04216.23
5.6.120.0060.03017.72
5.6.110.0090.04417.70
5.6.100.0100.03517.57
5.6.90.0070.04917.69
5.6.80.0080.03217.43
5.6.70.0000.01414.11
5.6.60.0000.00914.09
5.6.50.0030.00614.59
5.6.40.0030.01314.29
5.6.30.0040.01414.05
5.6.20.0030.00914.23
5.6.10.0060.00314.50
5.6.00.0070.01014.14
5.5.380.0040.01114.21
5.5.370.0070.00714.24
5.5.360.0030.00913.99
5.5.350.0080.04517.15
5.5.340.0020.03016.14
5.5.330.0020.04917.23
5.5.320.0130.02717.38
5.5.310.0130.04317.40
5.5.300.0070.04316.08
5.5.290.0080.03715.97
5.5.280.0040.02617.60
5.5.270.0070.02717.51
5.5.260.0170.03817.62
5.5.250.0100.03017.53
5.5.240.1170.02417.19
5.5.230.0090.00014.29
5.5.220.0000.01014.20
5.5.210.0090.00613.99
5.5.200.0070.00713.90
5.5.190.0040.00413.97
5.5.180.0030.01014.28
5.5.170.0080.00314.43
5.5.160.0160.00314.27
5.5.150.0100.00613.77
5.5.140.0090.00614.29
5.5.130.0060.00614.37
5.5.120.0090.00914.16
5.5.110.0090.00913.74
5.5.100.0100.00714.28
5.5.90.0030.01014.38
5.5.80.0060.00814.21
5.5.70.0070.01014.30
5.5.60.0070.00714.36
5.5.50.0030.01714.20
5.5.40.0070.00414.00
5.5.30.0140.00313.97
5.5.20.0060.00914.11
5.5.10.0040.00813.98
5.5.00.0090.00313.97

preferences:
56.45 ms | 401 KiB | 5 Q