3v4l.org

run code in 500+ PHP versions simultaneously
<?php // https://ru.stackoverflow.com/questions/1444784 class MyExc1 extends \Exception {} class MyExc2 extends \Exception {} class ExcController { private static $map = [ 22 => MyExc1::class, 28 => MyExc2::class, ]; public static function getExceptionClassByCode($curlErr) { return self::$map[$curlErr]; } public static function throwExceptionByCode($curlErr, $msg) { throw new self::$map[$curlErr]($msg); } } // обратите внимание на круглые скобки /* 1 */ throw new (ExcController::getExceptionClassByCode(22)); // throw new (MyExc1); /* 2 */ throw new (ExcController::getExceptionClassByCode(22))('qwerty'); // throw new (MyExc1)('qwerty') /* 3 */ ExcController::throwExceptionByCode(22, 'qwerty'); // идентичный результат

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.5.90.0030.00416.89
8.5.80.0060.00216.88
8.5.70.0080.00918.67
8.5.60.0120.00216.97
8.5.50.0110.00617.07
8.5.30.0110.00619.26
8.5.20.0120.00619.30
8.5.10.0070.01020.27
8.5.00.0170.00820.00
8.4.230.0170.00419.72
8.4.220.0110.01019.66
8.4.210.0100.01119.79
8.4.180.0140.00725.75
8.4.170.0120.00923.71
8.4.160.0140.00823.98
8.4.150.0060.00616.78
8.4.140.0130.00817.98
8.4.130.0110.00717.82
8.4.120.0080.00720.83
8.4.110.0070.00622.59
8.4.100.0040.00417.85
8.4.90.0130.00820.59
8.4.80.0050.00318.69
8.4.70.0090.01220.91
8.4.60.0120.00518.70
8.4.50.0150.00622.48
8.4.40.0090.01017.99
8.4.30.0160.00319.04
8.4.20.0100.01018.89
8.4.10.0040.00422.32
8.3.320.0090.01118.82
8.3.310.0130.00718.73
8.3.300.0120.01422.61
8.3.290.0190.00918.75
8.3.280.0070.00416.31
8.3.270.0130.00716.64
8.3.260.0110.00916.90
8.3.250.0120.00719.05
8.3.240.0120.00816.57
8.3.230.0110.00816.72
8.3.220.0140.00518.73
8.3.210.0110.00418.57
8.3.200.0030.00716.38
8.3.190.0080.01316.94
8.3.180.0100.00918.93
8.3.170.0050.00318.78
8.3.160.0150.00018.99
8.3.150.0090.00917.16
8.3.140.0120.00317.10
8.3.130.0080.00018.53
8.3.120.0070.00319.09
8.3.110.0040.00420.94
8.3.100.0060.01024.06
8.3.90.0000.00826.77
8.3.80.0060.00318.43
8.3.70.0070.01416.75
8.3.60.0060.00916.62
8.3.50.0090.00618.42
8.3.40.0060.00920.48
8.3.30.0090.00618.45
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0000.00726.16
8.2.320.0140.01118.13
8.2.310.0150.00918.10
8.2.300.0130.00818.15
8.2.290.0100.00816.67
8.2.280.0050.00418.78
8.2.270.0110.00719.06
8.2.260.0060.00316.70
8.2.250.0050.00318.37
8.2.240.0040.00717.30
8.2.230.0030.00722.58
8.2.220.0090.00037.54
8.2.210.0070.00026.77
8.2.200.0060.00318.54
8.2.190.0120.00316.58
8.2.180.0150.00025.92
8.2.170.0000.01518.94
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00020.90
8.2.110.0040.00421.00
8.2.100.0120.00017.91
8.2.90.0050.00220.59
8.2.80.0080.00019.29
8.2.70.0050.00317.63
8.2.60.0080.00017.63
8.2.50.0030.00518.05
8.2.40.0040.00418.28
8.2.30.0020.00518.09
8.2.20.0030.00519.28
8.2.10.0000.00818.04
8.2.00.0050.00221.07
8.1.340.0150.00517.77
8.1.330.0110.00721.70
8.1.320.0040.00517.83
8.1.310.0030.00616.84
8.1.300.0120.00316.21
8.1.290.0060.00330.84
8.1.280.0170.00325.92
8.1.270.0050.00224.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00722.51
8.1.230.0040.00820.85
8.1.220.0080.00017.75
8.1.210.0090.00019.04
8.1.200.0040.00417.34
8.1.190.0000.00817.21
8.1.180.0090.00318.10
8.1.170.0050.00317.62
8.1.160.0040.00418.89
8.1.150.0000.00818.59
8.1.140.0040.00417.41
8.1.130.0030.00318.84
8.1.120.0040.00417.31
8.1.110.0000.00717.32
8.1.100.0140.00517.38
8.1.90.0120.00417.29
8.1.80.0130.00317.43
8.1.70.0080.00817.27
8.1.60.0140.00517.40
8.1.50.0170.00417.30
8.1.40.0090.00917.46
8.1.30.0170.00317.63
8.1.20.0180.00017.42
8.1.10.0150.00317.49
8.1.00.0140.00617.47
8.0.300.0000.00819.98
8.0.290.0030.00616.75
8.0.280.0060.00318.30
8.0.270.0070.00016.80
8.0.260.0070.00018.44
8.0.250.0000.00717.01
8.0.240.0000.00716.98
8.0.230.0160.00016.85
8.0.220.0140.00316.70
8.0.210.0120.00416.86
8.0.200.0100.00516.91
8.0.190.0110.00616.85
8.0.180.0100.00516.75
8.0.170.0080.00816.93
8.0.160.0090.00616.97
8.0.150.0100.00516.86
8.0.140.0080.00816.96
8.0.130.0120.00516.82
8.0.120.0150.00016.87
8.0.110.0080.00816.98
8.0.100.0090.00616.91
8.0.90.0060.01116.99
8.0.80.0130.00316.82
8.0.70.0110.00516.88
8.0.60.0080.00816.96
8.0.50.0080.00716.95
8.0.30.0120.00316.90
8.0.20.0050.01016.98
8.0.10.0160.00016.86
7.4.330.0040.00015.55
7.4.320.0040.00416.35
7.4.300.0090.00616.30
7.4.290.0170.00016.31
7.4.280.0110.00616.27
7.4.270.0100.00716.24
7.4.260.0150.00316.39
7.4.250.0120.00616.41
7.4.240.0140.00316.33
7.4.230.0140.00416.36
7.4.220.0090.00716.48
7.4.210.0140.00016.29
7.4.200.0110.00416.30
7.4.190.0090.00516.52
7.4.180.0120.00316.52
7.4.160.0140.00016.41
7.4.150.0110.00516.28
7.4.140.0100.00516.21
7.4.130.0120.00316.24
7.4.120.0070.00716.15
7.4.110.0100.00416.22
7.4.100.0170.00016.40
7.4.90.0130.00316.21
7.4.80.0150.00016.25
7.4.70.0080.00816.36
7.4.60.0070.00716.29
7.4.50.0070.01016.07
7.4.40.0130.00416.14
7.4.30.0090.00616.32
7.4.20.0070.01116.10
7.4.10.0080.00816.28
7.4.00.0120.00816.25

preferences:
80.67 ms | 1302 KiB | 5 Q