3v4l.org

run code in 300+ PHP versions simultaneously
<?php function autoboxing_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { if (preg_match('/^Argument (\d+) passed to \S+ must be (?:an|an instance of|of the type) (\S+), \S+ given/', $errstr, $match)) { $bt = debug_backtrace(); $value = $bt[1]["args"][$match[1] - 1]; if (strcasecmp($match[2], "array") == 0) { $bt[1]["args"][$match[1] - 1] = array($value); return true; } else if (is_subclass_of($match[2], "Autoboxable")) { $bt[1]["args"][$match[1] - 1] = new $match[2]($value); return true; } } return false; } set_error_handler("autoboxing_error_handler"); interface Autoboxable { public function __construct($value); } class Integer implements Autoboxable { public $value = null; public function __construct($value) { $this->value = (int)$value; } } function foo(Integer $a, array $b) { var_dump($a->value); var_dump($b); } foo("1", 2);

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.130.0090.00016.72
8.3.120.0090.00020.63
8.3.110.0130.00616.66
8.3.100.0050.00318.54
8.3.90.0050.00326.77
8.3.80.0060.00616.75
8.3.70.0160.00616.75
8.3.60.0070.01118.16
8.3.50.0170.00521.20
8.3.40.0110.01118.76
8.3.30.0030.01019.18
8.3.20.0040.00420.34
8.3.10.0080.00021.65
8.3.00.0080.00023.61
8.2.250.0150.00318.33
8.2.240.0090.00017.28
8.2.230.0030.00620.94
8.2.220.0090.00024.06
8.2.210.0080.00026.77
8.2.200.0050.00518.41
8.2.190.0100.01018.29
8.2.180.0070.01125.92
8.2.170.0070.00718.96
8.2.160.0100.00722.96
8.2.150.0000.00825.66
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0030.00617.63
8.2.110.0090.00319.35
8.2.100.0000.01120.48
8.2.90.0080.00019.46
8.2.80.0050.00219.34
8.2.70.0050.00318.02
8.2.60.0030.00617.89
8.2.50.0000.00818.10
8.2.40.0040.00719.34
8.2.30.0050.00319.84
8.2.20.0040.00417.64
8.2.10.0040.00417.96
8.2.00.0040.00418.06
8.1.300.0070.01016.28
8.1.290.0060.00330.84
8.1.280.0110.00425.92
8.1.270.0110.00023.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.24
8.1.230.0080.00419.16
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0090.00017.35
8.1.190.0080.00017.35
8.1.180.0080.00018.10
8.1.170.0040.00418.65
8.1.160.0020.00522.04
8.1.150.0070.00018.85
8.1.140.0040.00417.48
8.1.130.0040.00417.42
8.1.120.0000.00717.41
8.1.110.0060.00317.32
8.1.100.0030.00517.38
8.1.90.0000.00817.45
8.1.80.0050.00217.32
8.1.70.0000.00917.44
8.1.60.0060.00317.55
8.1.50.0050.00217.54
8.1.40.0080.00017.46
8.1.30.0060.00317.46
8.1.20.0040.00417.46
8.1.10.0000.00717.55
8.1.00.0030.00617.36
8.0.300.0070.00019.77
8.0.290.0070.00016.75
8.0.280.0040.00418.46
8.0.270.0030.00317.32
8.0.260.0030.00316.89
8.0.250.0000.00716.98
8.0.240.0030.00316.93
8.0.230.0070.00017.08
8.0.220.0030.00317.02
8.0.210.0040.00416.98
8.0.200.0060.00017.07
8.0.190.0030.00616.93
8.0.180.0060.00616.98
8.0.170.0060.00317.06
8.0.160.0040.00417.00
8.0.150.0050.00316.94
8.0.140.0030.00416.97
8.0.130.0030.00313.45
8.0.120.0040.00416.92
8.0.110.0000.00716.99
8.0.100.0080.00016.91
8.0.90.0000.00716.97
8.0.80.0090.00917.00
8.0.70.0040.00416.85
8.0.60.0040.00416.82
8.0.50.0050.00216.99
8.0.30.0090.00917.07
8.0.20.0170.00617.40
8.0.10.0040.00417.03
8.0.00.0120.00616.88
7.4.330.0030.00315.08
7.4.320.0030.00316.42
7.4.300.0000.00616.57
7.4.290.0040.00416.38
7.4.280.0080.00016.45
7.4.270.0070.00016.37
7.4.260.0040.00416.34
7.4.250.0000.00816.58
7.4.240.0080.00016.60
7.4.230.0030.00616.67
7.4.220.0040.01316.57
7.4.210.0050.00916.42
7.4.200.0040.00316.35
7.4.160.0080.00816.38
7.4.150.0230.00317.40
7.4.140.0120.00917.86
7.4.130.0110.00916.50
7.4.120.0120.00516.46
7.4.110.0030.01416.60
7.4.100.0070.01116.51
7.4.90.0070.01016.27
7.4.80.0070.01019.39
7.4.70.0120.00616.60
7.4.60.0030.01316.54
7.4.50.0040.00416.57
7.4.40.0080.00816.64
7.4.30.0090.00916.70
7.4.00.0100.00714.88
7.3.330.0000.00513.28
7.3.320.0000.00513.25
7.3.310.0080.00016.32
7.3.300.0000.00716.32
7.3.290.0000.00716.23
7.3.280.0070.01216.29
7.3.270.0110.00617.40
7.3.260.0070.01516.25
7.3.250.0110.00816.41
7.3.240.0030.01516.43
7.3.230.0160.00916.42
7.3.210.0100.00716.45
7.3.200.0070.01016.61
7.3.190.0040.01116.59
7.3.180.0060.00916.48
7.3.170.0120.00816.41
7.3.160.0090.00916.52
7.3.120.0030.01514.78
7.3.110.0060.00914.95
7.3.100.0040.01114.65
7.3.90.0070.00314.85
7.3.80.0030.01514.90
7.3.70.0000.01414.85
7.3.60.0070.01014.90
7.3.50.0100.00614.69
7.3.40.0060.00914.89
7.3.30.0030.01014.87
7.3.20.0110.00416.41
7.3.10.0070.00716.50
7.3.00.0090.00716.60
7.2.330.0070.01116.45
7.2.320.0100.00616.57
7.2.310.0130.00316.81
7.2.300.0170.00016.55
7.2.290.0080.00816.64
7.2.240.0100.00614.82
7.2.230.0080.00414.81
7.2.220.0030.01314.92
7.2.210.0070.00715.16
7.2.200.0060.00914.84
7.2.190.0090.00614.73
7.2.180.0090.00614.91
7.2.170.0030.00714.98
7.2.160.0070.00714.77
7.2.150.0080.00416.91
7.2.140.0040.01416.95
7.2.130.0090.01116.45
7.2.120.0120.01016.62
7.2.110.0130.00616.67
7.2.100.0110.00816.87
7.2.90.0120.00916.46
7.2.80.0100.00816.74
7.2.70.0100.00816.31
7.2.60.0080.00616.64
7.2.50.0070.01116.58
7.2.40.0090.01216.66
7.2.30.0120.00716.75
7.2.20.0130.00716.58
7.2.10.0130.01016.83
7.2.00.0100.00916.66
7.1.330.0070.01015.84
7.1.320.0080.00815.74
7.1.310.0080.00015.61
7.1.300.0060.00915.61
7.1.290.0000.00915.89
7.1.280.0060.00915.76
7.1.270.0000.01115.71
7.1.260.0040.01115.77
7.1.250.0060.00915.36
7.1.200.0030.01015.41
7.1.70.0000.00917.16
7.1.60.0100.01619.42
7.1.50.0110.02534.54
7.1.00.0000.08022.28
7.0.200.0070.00016.73
7.0.60.0130.06319.95
7.0.50.0070.07717.90
7.0.40.0070.04020.09
7.0.30.0300.08020.21
7.0.20.0270.04720.20
7.0.10.0070.09020.20
7.0.00.0030.05720.05
5.6.280.0070.03021.14
5.6.210.0230.06020.68
5.6.200.0070.08318.29
5.6.190.0100.07720.57
5.6.180.0470.07020.64
5.6.170.0170.04320.54
5.6.160.0070.06020.61
5.6.150.0070.07718.19
5.6.140.0030.04718.17
5.6.130.0100.07718.14
5.6.120.0000.04321.00
5.6.110.0030.08021.04
5.6.100.0100.08020.98
5.6.90.0070.04021.12
5.6.80.0170.03020.37
5.5.350.0230.07320.41
5.5.340.0100.03718.02
5.5.330.0100.03720.41
5.5.320.0230.04020.35
5.5.310.0230.07720.35
5.5.300.0070.05717.98
5.5.290.0070.08017.97
5.5.280.0030.04320.90
5.5.270.0030.09020.87
5.5.260.0100.03320.88
5.5.250.0000.04320.70
5.5.240.0270.07320.27
5.4.450.0570.05719.71
5.4.440.0670.06019.45
5.4.430.0670.06019.47
5.4.420.0800.04019.47
5.4.410.0700.06019.47
5.4.400.0900.04719.16
5.4.390.1000.06019.32
5.4.380.0770.05719.37
5.4.370.0830.04019.25
5.4.360.0700.06019.17
5.4.350.0900.06319.23
5.4.340.0630.06019.01
5.4.320.0700.05719.16
5.4.310.0700.06019.30
5.4.300.0730.05319.14
5.4.290.0900.05719.13
5.4.280.1030.05018.97
5.4.270.0800.05719.13
5.4.260.0800.05319.27
5.4.250.0900.04719.36
5.4.240.0830.05019.27
5.4.230.0730.05718.85
5.4.220.0870.06318.85
5.4.210.0700.06018.97
5.4.200.0870.04716.73
5.4.190.0870.05018.86
5.4.180.0970.06318.96
5.4.170.0870.07019.18
5.4.160.0870.04718.98
5.4.150.0830.06319.01
5.4.140.0900.05016.67
5.4.130.0830.04716.29
5.4.120.0670.05316.35
5.4.110.0670.05016.36
5.4.100.0800.05316.33
5.4.90.0870.05716.50
5.4.80.1000.04016.29
5.4.70.0900.05316.45
5.4.60.0800.05316.63
5.4.50.0830.05016.21
5.4.40.0800.04316.47
5.4.30.0900.04316.22
5.4.20.0870.04716.46
5.4.10.0800.04716.63
5.4.00.0900.05315.83
5.3.290.0800.06014.77
5.3.280.0870.05314.66
5.3.270.0870.05014.73
5.3.260.0900.05314.75
5.3.250.0770.04314.70
5.3.240.0730.04714.54
5.3.230.0700.05314.59
5.3.220.0730.05014.75
5.3.210.0830.05314.55
5.3.200.0870.04714.55
5.3.190.0830.05014.79
5.3.180.0770.05014.66
5.3.170.0700.05314.64
5.3.160.0670.06314.55
5.3.150.0730.05014.66
5.3.140.0800.04014.78
5.3.130.0870.04714.62
5.3.120.0630.05714.59
5.3.110.0600.06014.63
5.3.100.0870.06014.36
5.3.90.0800.05314.00
5.3.80.0830.05314.14
5.3.70.0900.04014.16
5.3.60.0770.05313.98
5.3.50.0830.05013.93
5.3.40.0900.04014.07
5.3.30.0830.05014.00
5.3.20.0830.04713.68
5.3.10.0770.05013.78
5.3.00.0770.05313.86
5.2.170.0700.03711.20
5.2.160.0670.03711.23
5.2.150.0670.04011.18
5.2.140.0700.04011.23
5.2.130.0670.04711.28
5.2.120.0630.04011.25
5.2.110.0670.04011.09
5.2.100.0700.04711.23
5.2.90.0670.04311.10
5.2.80.0770.04011.09
5.2.70.0700.03711.11
5.2.60.0530.04711.17
5.2.50.0570.05011.15
5.2.40.0630.04310.98
5.2.30.0600.04310.97
5.2.20.0570.03711.01
5.2.10.0600.04710.93
5.2.00.0430.04010.89
5.1.60.0700.03710.09
5.1.50.0500.03710.07
5.1.40.0500.0379.92
5.1.30.0500.03310.32
5.1.20.0570.04010.41
5.1.10.0470.04010.16
5.1.00.0530.0339.96
5.0.50.0300.0378.50
5.0.40.0330.0238.41
5.0.30.0230.0438.14
5.0.20.0270.0308.05
5.0.10.0370.0238.25
5.0.00.0330.0378.08
4.4.90.0300.0335.88
4.4.80.0270.0275.94
4.4.70.0370.0175.84
4.4.60.0330.0175.87
4.4.50.0230.0235.82
4.4.40.0270.0375.86
4.4.30.0270.0235.77
4.4.20.0330.0175.90
4.4.10.0130.0305.94
4.4.00.0300.0375.89
4.3.110.0330.0235.79
4.3.100.0270.0235.81
4.3.90.0300.0205.68
4.3.80.0270.0405.72
4.3.70.0300.0235.74
4.3.60.0330.0205.80
4.3.50.0270.0275.85
4.3.40.0370.0375.74
4.3.30.0130.0304.62
4.3.20.0130.0234.50
4.3.10.0130.0274.47
4.3.00.0130.0237.00

preferences:
75.39 ms | 403 KiB | 5 Q