3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct() { $args = func_get_args(); switch (count($args)) { case 2: return call_user_func_array(array($this, 'constr2'), $args); case 1: return call_user_func_array(array($this, 'constr1'), $args); } throw new Exception("invalid number of arguments"); } protected function constr1($a) { print "constr1 called\n"; } protected function constr2($a, $b) { print "constr2 called\n"; } } $a = new Foo(2); $b = new Foo(2, 3); $c = new Foo("a", "b", 3);

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.0140.00716.75
8.3.50.0090.00616.47
8.3.40.0190.00318.97
8.3.30.0110.00418.81
8.3.20.0000.00720.29
8.3.10.0050.00323.66
8.3.00.0030.00523.61
8.2.180.0160.00618.54
8.2.170.0120.00322.96
8.2.160.0090.00620.39
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00321.13
8.2.110.0030.00722.07
8.2.100.0070.00417.84
8.2.90.0080.00017.99
8.2.80.0000.00819.28
8.2.70.0040.00417.63
8.2.60.0030.00617.63
8.2.50.0020.00517.93
8.2.40.0000.00819.78
8.2.30.0040.00419.43
8.2.20.0030.00617.81
8.2.10.0020.00518.00
8.2.00.0070.00018.11
8.1.280.0100.01025.92
8.1.270.0060.00620.37
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00622.13
8.1.230.0070.00421.04
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.22
8.1.190.0030.00617.35
8.1.180.0080.00018.10
8.1.170.0080.00017.62
8.1.160.0070.00020.66
8.1.150.0030.00518.89
8.1.140.0050.00319.63
8.1.130.0000.00717.58
8.1.120.0030.00317.38
8.1.110.0030.00417.35
8.1.100.0000.00817.50
8.1.90.0000.00717.48
8.1.80.0050.00217.45
8.1.70.0000.00717.36
8.1.60.0070.00017.48
8.1.50.0030.00517.45
8.1.40.0040.00417.50
8.1.30.0050.00317.59
8.1.20.0040.00417.60
8.1.10.0000.00717.51
8.1.00.0050.00217.57
8.0.300.0040.00420.21
8.0.290.0080.00016.63
8.0.280.0030.00318.45
8.0.270.0040.00417.14
8.0.260.0030.00317.25
8.0.250.0040.00417.07
8.0.240.0030.00317.02
8.0.230.0000.00817.03
8.0.220.0030.00316.82
8.0.210.0000.00716.98
8.0.200.0030.00317.05
8.0.190.0060.00316.94
8.0.180.0070.00017.04
8.0.170.0040.00417.00
8.0.160.0000.00717.00
8.0.150.0000.00716.94
8.0.140.0020.00516.95
8.0.130.0000.00613.36
8.0.120.0040.00416.83
8.0.110.0070.00016.85
8.0.100.0040.00417.07
8.0.90.0000.00817.02
8.0.80.0120.00416.95
8.0.70.0060.00316.96
8.0.60.0040.00417.02
8.0.50.0000.00816.97
8.0.30.0140.00617.19
8.0.20.0100.01117.40
8.0.10.0040.00416.88
8.0.00.0110.00816.76
7.4.330.0030.00316.82
7.4.320.0050.00216.41
7.4.300.0040.00416.59
7.4.290.0040.00416.53
7.4.280.0030.00616.54
7.4.270.0050.00316.46
7.4.260.0080.00316.49
7.4.250.0030.00516.47
7.4.240.0000.00816.53
7.4.230.0040.00416.63
7.4.220.0060.01016.53
7.4.210.0080.00516.63
7.4.200.0030.00316.58
7.4.160.0120.00416.66
7.4.150.0090.01417.40
7.4.140.0110.00817.86
7.4.130.0090.01016.59
7.4.120.0140.00516.53
7.4.110.0070.01116.53
7.4.100.0060.01616.45
7.4.90.0080.01616.57
7.4.80.0110.00719.39
7.4.70.0060.01716.48
7.4.60.0000.01716.41
7.4.50.0030.01216.49
7.4.40.0100.00616.54
7.4.30.0140.00316.38
7.4.00.0100.00315.19
7.3.330.0060.00013.22
7.3.320.0000.00613.37
7.3.310.0000.00716.26
7.3.300.0000.00616.22
7.3.290.0100.00716.35
7.3.280.0060.01216.33
7.3.270.0120.00617.40
7.3.260.0040.01216.52
7.3.240.0110.00716.54
7.3.230.0130.00616.42
7.3.210.0140.00816.36
7.3.200.0110.00719.39
7.3.190.0000.01916.38
7.3.180.0120.00616.30
7.3.170.0100.01016.48
7.3.160.0160.00616.55
7.2.330.0120.00916.72
7.2.320.0170.00716.81
7.2.310.0070.01016.84
7.2.300.0130.01016.78
7.2.290.0050.01416.60
7.2.60.0090.00616.97
7.2.00.0000.01119.65
7.1.200.0050.00615.45
7.1.100.0070.00717.80
7.1.70.0000.01017.10
7.1.60.0120.01219.20
7.1.50.0040.01816.96
7.1.00.0100.07022.57
7.0.200.0030.00516.95
7.0.60.0230.04721.73
7.0.50.0030.06017.73
7.0.40.0070.06320.16
7.0.30.0330.09020.06
7.0.20.0430.08320.26
7.0.10.0070.04320.29
7.0.00.0070.08720.10
5.6.280.0000.05720.79
5.6.210.0170.07720.48
5.6.200.0070.05718.19
5.6.190.0070.04720.48
5.6.180.0230.05320.39
5.6.170.0300.04020.47
5.6.160.0030.08020.55
5.6.150.0100.07718.18
5.6.140.0100.08018.11
5.6.130.0030.04318.21
5.6.120.0130.07720.99
5.6.110.0070.08320.96
5.6.100.0070.06020.98
5.6.90.0070.07721.04
5.6.80.0070.06020.53
5.5.350.0030.08320.37
5.5.340.0070.08318.04
5.5.330.0030.04020.42
5.5.320.0270.06020.25
5.5.310.0200.04020.24
5.5.300.0070.04018.01
5.5.290.0130.06717.98
5.5.280.0070.08320.66
5.5.270.0070.07320.82
5.5.260.0030.06320.80
5.5.250.0070.07720.46
5.5.240.0130.06720.19

preferences:
51.5 ms | 400 KiB | 5 Q