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); //break; case 1: return call_user_func_array(array($this, 'constr1'), $args); break; } 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.70.0130.00316.63
8.3.60.0150.00318.43
8.3.50.0130.00921.15
8.3.40.0110.00318.65
8.3.30.0070.00718.67
8.3.20.0070.00020.21
8.3.10.0050.00323.65
8.3.00.0050.00223.66
8.2.190.0060.01516.88
8.2.180.0070.01418.54
8.2.170.0160.00022.96
8.2.160.0070.00720.57
8.2.150.0040.00424.18
8.2.140.0070.00324.66
8.2.130.0040.00419.89
8.2.120.0080.00026.35
8.2.110.0090.00022.20
8.2.100.0060.00617.84
8.2.90.0060.00318.03
8.2.80.0000.01019.29
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0000.00822.05
8.2.30.0020.00519.42
8.2.20.0000.00717.78
8.2.10.0040.00419.89
8.2.00.0000.00818.06
8.1.280.0100.01025.92
8.1.270.0080.00020.25
8.1.260.0000.00828.09
8.1.250.0080.00028.09
8.1.240.0090.00022.07
8.1.230.0080.00320.84
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0000.01017.35
8.1.190.0080.00017.22
8.1.180.0050.00318.10
8.1.170.0050.00318.70
8.1.160.0040.00420.77
8.1.150.0040.00418.93
8.1.140.0000.00819.58
8.1.130.0000.00717.70
8.1.120.0040.00417.46
8.1.110.0030.00417.31
8.1.100.0000.00817.45
8.1.90.0030.00517.49
8.1.80.0000.00717.43
8.1.70.0000.00717.42
8.1.60.0030.00517.51
8.1.50.0060.00317.53
8.1.40.0030.00517.55
8.1.30.0000.00817.67
8.1.20.0040.00417.63
8.1.10.0050.00217.45
8.1.00.0040.00417.53
8.0.300.0070.00020.00
8.0.290.0000.00816.75
8.0.280.0050.00318.45
8.0.270.0000.00717.25
8.0.260.0030.00317.17
8.0.250.0000.00716.94
8.0.240.0030.00317.02
8.0.230.0070.00017.06
8.0.220.0070.00016.93
8.0.210.0070.00016.85
8.0.200.0030.00317.00
8.0.190.0070.00017.03
8.0.180.0040.00416.99
8.0.170.0080.00017.00
8.0.160.0020.00517.02
8.0.150.0040.00416.85
8.0.140.0000.00816.93
8.0.130.0030.00313.39
8.0.120.0030.00516.93
8.0.110.0000.00916.97
8.0.100.0040.00416.73
8.0.90.0000.00716.83
8.0.80.0130.00316.84
8.0.70.0040.00416.88
8.0.60.0070.00016.74
8.0.50.0040.00416.78
8.0.30.0070.01317.21
8.0.20.0080.01117.40
8.0.10.0070.00016.97
8.0.00.0120.00816.83
7.4.330.0000.00516.69
7.4.320.0070.00016.44
7.4.300.0060.00316.59
7.4.290.0040.00416.60
7.4.280.0060.00316.59
7.4.270.0040.00416.41
7.4.260.0030.00316.54
7.4.250.0040.00416.46
7.4.240.0040.00416.46
7.4.230.0000.00716.32
7.4.220.0090.01216.47
7.4.210.0100.00716.61
7.4.200.0070.00016.56
7.4.160.0150.00016.66
7.4.150.0200.00417.40
7.4.140.0090.00917.86
7.4.130.0120.00716.53
7.4.120.0130.00916.56
7.4.110.0070.01016.61
7.4.100.0030.01416.60
7.4.90.0120.00616.43
7.4.80.0060.01219.39
7.4.70.0100.01316.66
7.4.60.0070.01016.55
7.4.50.0090.00616.48
7.4.40.0150.00616.37
7.4.30.0070.01016.41
7.4.10.0060.01315.05
7.4.00.0060.01015.02
7.3.330.0060.00013.32
7.3.320.0000.00613.37
7.3.310.0020.00516.21
7.3.300.0040.00416.35
7.3.290.0100.00716.37
7.3.280.0080.01116.33
7.3.270.0120.00617.40
7.3.260.0170.00016.35
7.3.250.0110.00716.46
7.3.240.0110.00816.49
7.3.230.0120.00616.44
7.3.210.0180.00616.50
7.3.200.0070.01019.39
7.3.190.0070.01116.59
7.3.180.0060.01216.31
7.3.170.0160.00616.52
7.3.160.0070.01016.46
7.3.130.0030.01014.96
7.3.120.0050.01414.85
7.3.110.0080.01014.80
7.3.100.0060.00814.84
7.3.90.0060.00914.77
7.3.80.0050.00614.84
7.3.70.0060.00514.92
7.3.60.0050.00914.87
7.3.50.0050.00814.79
7.3.40.0060.00814.82
7.3.30.0100.00214.69
7.3.20.0030.01016.77
7.3.10.0040.00716.59
7.3.00.0080.00716.67
7.2.330.0110.00616.73
7.2.320.0180.00616.77
7.2.310.0100.01316.68
7.2.300.0090.01316.75
7.2.290.0120.00616.54
7.2.260.0070.01014.72
7.2.250.0080.01315.20
7.2.240.0080.00914.76
7.2.230.0040.01014.99
7.2.220.0060.00715.11
7.2.210.0080.00415.06
7.2.200.0040.00715.11
7.2.190.0040.01114.87
7.2.180.0050.01014.98
7.2.170.0040.01014.91
7.2.160.0100.00315.21
7.2.150.0040.01116.70
7.2.140.0070.00716.90
7.2.130.0070.00716.86
7.2.120.0080.00416.93
7.2.110.0000.01816.86
7.2.100.0100.00316.75
7.2.90.0160.00017.09
7.2.80.0090.00616.87
7.2.70.0090.00617.03
7.2.60.0050.00517.07
7.2.50.0070.01017.02
7.2.40.0080.00317.04
7.2.30.0090.00016.68
7.2.20.0120.00316.91
7.2.10.0030.01416.79
7.2.00.0070.00718.12
7.1.330.0060.00715.65
7.1.320.0040.00915.76
7.1.310.0100.00515.93
7.1.300.0060.00915.75
7.1.290.0080.00515.63
7.1.280.0100.00315.77
7.1.270.0080.00715.55
7.1.260.0020.00815.67
7.1.250.0090.00615.71
7.1.240.0030.00915.79
7.1.230.0070.00715.87
7.1.220.0040.00815.38
7.1.210.0040.00715.82
7.1.200.0030.00615.69
7.1.190.0000.01215.77
7.1.180.0030.01015.87
7.1.170.0000.00915.62
7.1.160.0040.01115.72
7.1.150.0060.00615.73
7.1.140.0060.00615.72
7.1.130.0070.00715.87
7.1.120.0060.00915.77
7.1.110.0100.00315.64
7.1.100.0190.00516.94
7.1.90.0030.01015.67
7.1.80.0030.00915.87
7.1.70.0050.00416.31
7.1.60.0030.01517.52
7.1.50.0050.00816.31
7.1.40.0060.00815.95
7.1.30.0040.00715.56
7.1.20.0070.00715.84
7.1.10.0090.00315.92
7.1.00.0070.04019.00
7.0.330.0000.01115.64
7.0.320.0000.01215.60
7.0.310.0030.00815.42
7.0.300.0140.00015.14
7.0.290.0060.00615.43
7.0.280.0100.00315.41
7.0.270.0060.00315.60
7.0.260.0080.00515.46
7.0.250.0040.01115.59
7.0.240.0070.00715.48
7.0.230.0030.00915.47
7.0.220.0060.00615.26
7.0.210.0060.00615.59
7.0.200.0010.00816.15
7.0.190.0030.00915.50
7.0.180.0070.00715.20
7.0.170.0040.00715.31
7.0.160.0100.00315.11
7.0.150.0000.00815.45
7.0.140.0070.00315.54
7.0.130.0100.00315.56
7.0.120.0030.01115.62
7.0.110.0040.00415.54
7.0.100.0040.00815.60
7.0.90.0030.00615.45
7.0.80.0060.00615.55
7.0.70.0060.00915.50
7.0.60.0110.04318.59
7.0.50.0090.03716.70
7.0.40.0070.02316.80
7.0.30.0170.03916.90
7.0.20.0180.02716.76
7.0.10.0020.02816.80
7.0.00.0070.03016.86
5.6.400.0030.01614.44
5.6.390.0100.00314.41
5.6.380.0100.00313.99
5.6.370.0030.00814.01
5.6.360.0080.00314.30
5.6.350.0060.00314.13
5.6.340.0070.00714.40
5.6.330.0060.00314.28
5.6.320.0060.00914.50
5.6.310.0030.01314.30
5.6.300.0090.00314.17
5.6.290.0030.01014.39
5.6.280.0000.02717.86
5.6.270.0030.00814.41
5.6.260.0000.01314.36
5.6.250.0060.00314.39
5.6.240.0030.00614.42
5.6.230.0040.00414.47
5.6.220.0000.01214.58
5.6.210.0070.03717.50
5.6.200.0070.03716.41
5.6.190.0060.05017.51
5.6.180.0160.02217.38
5.6.170.0200.04017.46
5.6.160.0100.04017.47
5.6.150.0090.02016.31
5.6.140.0080.04216.15
5.6.130.0030.02516.12
5.6.120.0060.04517.64
5.6.110.0080.04317.58
5.6.100.0080.04217.62
5.6.90.0080.04217.57
5.6.80.0110.04617.28
5.6.70.0040.00414.34
5.6.60.0040.00814.16
5.6.50.0090.00614.34
5.6.40.0000.01514.15
5.6.30.0060.00614.56
5.6.20.0030.01014.41
5.6.10.0090.00314.05
5.6.00.0130.00014.17
5.5.380.0100.00314.37
5.5.370.0030.01014.33
5.5.360.0040.00814.43
5.5.350.0020.04917.32
5.5.340.0080.04216.12
5.5.330.0040.02117.35
5.5.320.0230.03317.49
5.5.310.0050.04917.35
5.5.300.0020.04416.27
5.5.290.0070.02515.96
5.5.280.0080.03917.29
5.5.270.0100.04517.33
5.5.260.0100.04317.33
5.5.250.0080.04217.48
5.5.240.0100.04017.17
5.5.230.0090.00314.25
5.5.220.0110.00314.27
5.5.210.0070.00714.37
5.5.200.0000.01114.39
5.5.190.0060.00614.17
5.5.180.0090.00614.06
5.5.170.0100.00014.36
5.5.160.0060.00614.02
5.5.150.0040.01214.38
5.5.140.0040.00414.25
5.5.130.0030.01313.95
5.5.120.0000.01114.32
5.5.110.0030.00714.05
5.5.100.0060.00314.36
5.5.90.0070.00714.29
5.5.80.0030.00914.02
5.5.70.0040.00714.01
5.5.60.0110.00314.06
5.5.50.0030.01314.22
5.5.40.0000.01614.40
5.5.30.0000.01513.95
5.5.20.0070.00714.36
5.5.10.0090.00613.97
5.5.00.0090.00614.38

preferences:
53.56 ms | 401 KiB | 5 Q