3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar { public function firstTypeError ($passed) { $trace = debug_backtrace(); throw new TypeError(__CLASS__ . "::" . __FUNCTION__ . "(): Argument #1 (\$passed) elements must be of type " . Baz::class . ", " . get_debug_Type($passed) . " given, called in " . $trace[0]["file"] . " on line " . $trace[0]["line"]); } public function secondTypeError ($passed) { $trace = debug_backtrace(); throw new TypeError(__CLASS__ . "::" . __FUNCTION__ . "(): Argument #1 (\$passed) elements must be of type " . Baz::class . ", " . get_debug_Type($passed) . " given"); } } class Baz {} $bar = new Bar(); try { $bar->firstTypeError("test"); } catch (TypeError $e) { echo $e->__toString(); } echo "\n\n\n\n"; try { $bar->secondTypeError("test"); } catch (TypeError $e) { echo $e->__toString(); }

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.4.120.0090.01120.60
8.4.110.0080.00322.54
8.4.100.0120.00817.81
8.4.90.0090.01218.86
8.4.80.0080.00217.95
8.4.70.0100.00918.04
8.4.60.0120.00718.91
8.4.50.0100.00718.66
8.4.40.0130.00618.00
8.4.30.0100.00618.81
8.4.20.0040.01817.60
8.4.10.0050.00319.84
8.3.250.0120.00719.01
8.3.240.0110.01016.65
8.3.230.0130.00616.82
8.3.220.0060.00217.28
8.3.210.0090.01016.76
8.3.200.0050.00316.73
8.3.190.0110.00718.94
8.3.180.0070.00316.52
8.3.170.0040.00418.73
8.3.160.0150.00418.18
8.3.150.0030.00716.98
8.3.140.0080.00816.66
8.3.130.0070.01016.50
8.3.120.0050.00320.71
8.3.110.0040.00420.94
8.3.100.0030.00624.06
8.3.90.0050.00326.77
8.3.80.0000.00917.97
8.3.70.0040.01118.16
8.3.60.0060.00918.43
8.3.50.0150.00316.50
8.3.40.0000.01420.38
8.3.30.0070.00720.34
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0100.00828.09
8.2.290.0120.00620.42
8.2.280.0090.01018.33
8.2.270.0140.00418.83
8.2.260.0070.00016.85
8.2.250.0030.00617.09
8.2.240.0090.00018.84
8.2.230.0060.00322.58
8.2.220.0090.00337.54
8.2.210.0070.00726.77
8.2.200.0080.00316.75
8.2.190.0120.00618.47
8.2.180.0140.00318.29
8.2.170.0150.00418.98
8.2.160.0100.00322.96
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0070.01128.09
8.2.120.0150.00428.09
8.2.110.0130.00628.09
8.2.100.0110.00728.09
8.2.90.0150.00028.09
8.2.80.0070.01328.09
8.2.70.0120.00628.09
8.2.60.0060.00328.09
8.2.50.0150.00328.09
8.2.40.0030.00628.09
8.2.30.0050.00328.09
8.2.20.0120.00628.09
8.2.10.0040.01428.09
8.2.00.0150.00028.09
8.1.330.0110.00722.08
8.1.320.0090.01016.38
8.1.310.0090.00916.54
8.1.300.0060.00316.35
8.1.290.0070.00330.84
8.1.280.0000.01525.92
8.1.270.0080.00022.24
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0070.00728.09
8.1.230.0140.00428.09
8.1.220.0110.00728.09
8.1.210.0060.00928.09
8.1.200.0060.00328.09
8.1.190.0060.00328.09
8.1.180.0050.00328.09
8.1.170.0080.00028.09
8.1.160.0050.00328.09
8.1.150.0040.00428.09
8.1.140.0040.00428.09
8.1.130.0040.00428.09
8.1.120.0040.00428.09
8.1.110.0040.00428.09
8.1.100.0040.00428.09
8.1.90.0040.00428.09
8.1.80.0080.00028.09
8.1.70.0050.00328.09
8.1.60.0080.00028.09
8.1.50.0050.00328.09
8.1.40.0060.00328.09
8.1.30.0040.00428.09
8.1.20.0040.00428.09
8.1.10.0040.00428.09
8.1.00.0040.00428.09

preferences:
27.73 ms | 403 KiB | 5 Q