3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * NewException * Extends the Exception class so that the $message parameter is now mendatory. * */ class NewException extends Exception { //$message is now not optional, just for the extension. public function __construct($message, $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); } } /** * TestException * Tests and throws Exceptions. */ class TestException { const NONE = 0; const NORMAL = 1; const CUSTOM = 2; public function __construct($type = self::NONE) { switch ($type) { case 1: throw new Exception('Normal Exception'); break; case 2: throw new NewException('Custom Exception'); break; default: return 0; //No exception is thrown. } } } try { $t = new TestException(TestException::CUSTOM); } catch (Exception $e) { print_r($e); //Exception Caught } ?>

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.0080.00818.30
8.3.50.0210.00922.04
8.3.40.0040.01218.96
8.3.30.0090.00619.04
8.3.20.0140.00020.16
8.3.10.0040.00423.66
8.3.00.0080.00020.41
8.2.180.0040.01116.50
8.2.170.0100.01022.96
8.2.160.0100.00322.14
8.2.150.0040.00424.18
8.2.140.0030.00724.66
8.2.130.0040.00426.16
8.2.120.0000.00817.50
8.2.110.0060.00322.08
8.2.100.0060.00617.91
8.2.90.0070.00019.22
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0050.00318.04
8.2.50.0000.00818.07
8.2.40.0030.00618.08
8.2.30.0080.00017.88
8.2.20.0080.00017.55
8.2.10.0050.00217.77
8.2.00.0040.00417.82
8.1.280.0140.00325.92
8.1.270.0030.00623.69
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0080.00023.77
8.1.230.0070.00319.01
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0080.00017.35
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0100.00018.66
8.1.160.0000.00722.03
8.1.150.0030.00618.68
8.1.140.0040.00417.39
8.1.130.0070.00017.88
8.1.120.0050.00217.56
8.1.110.0000.00717.53
8.1.100.0000.00717.54
8.1.90.0030.00617.47
8.1.80.0040.00417.39
8.1.70.0000.00717.49
8.1.60.0040.00417.68
8.1.50.0040.00417.41
8.1.40.0030.00517.57
8.1.30.0030.00617.52
8.1.20.0030.00617.74
8.1.10.0040.00417.62
8.1.00.0050.00317.46
8.0.300.0040.00418.77
8.0.290.0040.00417.03
8.0.280.0070.00018.27
8.0.270.0030.00317.18
8.0.260.0040.00416.84
8.0.250.0000.00616.88
8.0.240.0040.00416.97
8.0.230.0030.00316.94
8.0.220.0040.00416.84
8.0.210.0040.00416.98
8.0.200.0070.00016.84
8.0.190.0000.00817.00
8.0.180.0000.00816.93
8.0.170.0030.00516.79
8.0.160.0040.00416.85
8.0.150.0040.00416.86
8.0.140.0000.00716.92
8.0.130.0030.00313.36
8.0.120.0000.00716.97
8.0.110.0000.00816.83
8.0.100.0050.00217.09
8.0.90.0000.00717.02
8.0.80.0070.01516.96
8.0.70.0000.00717.00
8.0.60.0040.00416.88
8.0.50.0000.00717.00
8.0.30.0060.01417.18
8.0.20.0100.00817.28
8.0.10.0070.00717.05
8.0.00.0110.00816.92
7.4.330.0050.00015.08
7.4.320.0030.00316.64
7.4.300.0030.00316.54
7.4.290.0070.00016.60
7.4.280.0040.00416.52
7.4.270.0000.00816.45
7.4.260.0080.00016.63
7.4.250.0040.00416.40
7.4.240.0030.00316.59
7.4.230.0030.00316.56
7.4.220.0050.01116.56
7.4.210.0050.01216.54
7.4.200.0000.00716.54
7.4.190.0070.00016.61
7.4.160.0050.01016.59
7.4.150.0050.01117.02
7.4.140.0070.00917.35
7.4.130.0080.00916.51
7.4.120.0090.00716.58
7.4.110.0100.00816.63
7.4.100.0050.01016.53
7.4.90.0080.00816.54
7.4.80.0060.00916.52
7.4.70.0080.00816.47
7.4.60.0110.00516.44
7.4.50.0060.00516.43
7.4.40.0080.00619.58
7.4.30.0080.00716.35
7.4.20.0090.00616.45
7.4.10.0100.00316.49
7.4.00.0050.01015.50
7.3.330.0000.00513.34
7.3.320.0000.00513.38
7.3.310.0030.00416.48
7.3.300.0000.00616.30
7.3.290.0110.00316.41
7.3.280.0120.00616.39
7.3.270.0130.00816.89
7.3.260.0080.01016.49
7.3.250.0100.00616.41
7.3.240.0080.00716.37
7.3.230.0050.01016.39
7.3.220.0070.00716.38
7.3.210.0100.00816.45
7.3.200.0060.00917.89
7.3.190.0080.00716.47
7.3.180.0090.00816.46
7.3.170.0080.00916.38
7.3.160.0130.00416.43
7.3.150.0070.00716.39
7.3.140.0060.00616.35
7.3.130.0070.00716.36
7.3.120.0070.00915.32
7.3.110.0060.00915.67
7.3.100.0090.00515.56
7.3.90.0070.00415.65
7.3.80.0080.00815.50
7.3.70.0040.01215.59
7.3.60.0070.01315.70
7.3.50.0050.01315.65
7.3.40.0070.01015.64
7.3.30.0080.00715.52
7.3.20.0070.00916.55
7.3.10.0030.01216.48
7.3.00.0090.00616.32
7.2.340.0210.00616.37
7.2.330.0250.00716.39
7.2.320.0170.00816.37
7.2.310.0120.00916.48
7.2.300.0100.01016.38
7.2.290.0140.00716.43
7.2.280.0170.00816.38
7.2.270.0210.00316.30
7.2.260.0190.00416.26
7.2.250.0050.01215.66
7.2.240.0150.00615.61
7.2.230.0080.01315.41
7.2.220.0070.01615.55
7.2.210.0130.00715.53
7.2.200.0160.01215.76
7.2.190.0110.00815.75
7.2.180.0090.01215.63
7.2.170.0190.00315.73
7.2.160.0230.00816.50
7.2.150.0190.01416.63
7.2.140.0230.00316.64
7.2.130.0190.00616.75
7.2.120.0210.00816.67
7.2.110.0210.00616.68
7.2.100.0460.00416.67
7.2.90.0220.00816.64
7.2.80.0160.01616.59
7.2.70.0330.00716.63
7.2.60.0200.00716.56
7.2.50.0170.00816.59
7.2.40.0210.00616.57
7.2.30.0100.02016.76
7.2.20.0230.00316.66
7.2.10.0150.01516.54
7.2.00.0080.00818.01
7.1.330.0130.00715.59
7.1.320.0190.00515.77
7.1.310.0100.00715.53
7.1.300.0130.00415.63
7.1.290.0120.00815.41
7.1.280.0090.01115.66
7.1.270.0100.00815.59
7.1.260.0120.00815.59
7.1.250.0180.00615.48
7.1.240.0210.00315.52
7.1.230.0000.02515.47
7.1.220.0180.01415.48
7.1.210.0190.01015.49
7.1.200.0140.01115.54
7.1.190.0180.00715.46
7.1.180.0150.00915.44
7.1.170.0140.01015.46
7.1.160.0190.00615.39
7.1.150.0180.00915.39
7.1.140.0170.00915.38
7.1.130.0160.01015.44
7.1.120.0650.01415.47
7.1.110.0150.00915.46
7.1.100.0080.00916.82
7.1.90.0130.01015.52
7.1.80.0190.00815.53
7.1.70.0140.00416.22
7.1.60.0180.01117.40
7.1.50.0120.01216.13
7.1.40.0160.00715.46
7.1.30.0170.00715.59
7.1.20.0130.01015.42
7.1.10.0140.00815.57
7.1.00.0110.04018.84
7.0.330.0140.00915.02
7.0.320.0160.00915.16
7.0.310.0100.01415.11
7.0.300.0100.01515.17
7.0.290.0120.01215.09
7.0.280.0130.00915.09
7.0.270.0150.01115.18
7.0.260.0160.00815.26
7.0.250.0190.00815.21
7.0.240.0190.00415.43
7.0.230.0140.01115.32
7.0.220.0210.00915.27
7.0.210.0170.01015.36
7.0.200.0120.00716.07
7.0.190.0210.00315.24
7.0.180.0150.01115.30
7.0.170.0240.00015.46
7.0.160.0130.01315.19
7.0.150.0130.01015.31
7.0.140.0130.03718.58
7.0.130.0190.00415.28
7.0.120.0230.00815.23
7.0.110.0170.00715.03
7.0.100.0080.05017.62
7.0.90.0100.04817.52
7.0.80.0190.04017.51
7.0.70.0180.03517.58
7.0.60.0120.02617.54
7.0.50.0140.03917.73
7.0.40.0090.03917.72
7.0.30.0090.04817.64
7.0.20.0180.03517.62
7.0.10.0170.04717.67
7.0.00.0140.04517.61
5.6.400.0120.01215.72
5.6.390.0130.01315.69
5.6.380.0210.00315.71
5.6.370.0110.01415.68
5.6.360.0200.00515.70
5.6.350.0170.00615.89
5.6.340.0120.01215.78
5.6.330.0270.00315.77
5.6.320.0210.00715.73
5.6.310.0250.00415.77
5.6.300.0190.00515.54
5.6.290.0200.00615.72
5.6.280.0140.03818.32
5.6.270.0130.01315.86
5.6.260.0170.01015.63
5.6.250.0160.03818.16
5.6.240.0130.04718.24
5.6.230.0150.02318.12
5.6.220.0050.03518.18
5.6.210.0130.04418.16
5.6.200.0100.03218.49
5.6.190.0070.04718.50
5.6.180.0090.04218.51
5.6.170.0170.04018.42
5.6.160.0180.04418.51
5.6.150.0180.04218.50
5.6.140.0090.04718.40
5.6.130.0160.03218.42
5.6.120.0110.04618.37
5.6.110.0140.04818.40
5.6.100.0130.03818.46
5.6.90.0130.04018.38
5.6.80.0100.03218.03
5.6.70.0230.03618.08
5.6.60.0160.04118.16
5.6.50.0150.04018.05
5.6.40.0140.04118.10
5.6.30.0110.04118.07
5.6.20.0120.04418.00
5.6.10.0100.04617.95
5.6.00.0130.02518.07
5.5.380.0070.04018.11
5.5.370.0110.05018.15
5.5.360.0140.04318.03
5.5.350.0120.02918.02
5.5.340.0150.03618.26
5.5.330.0140.02718.22
5.5.320.0180.03818.27
5.5.310.0150.04918.20
5.5.300.0110.05018.24
5.5.290.0190.03818.23
5.5.280.0130.04818.31
5.5.270.0200.04118.28
5.5.260.0130.02918.20
5.5.250.0160.02018.29
5.5.240.0090.04217.98
5.5.230.0120.04318.03
5.5.220.0130.04518.05
5.5.210.0110.04217.92
5.5.200.0140.03417.89
5.5.190.0130.04017.85
5.5.180.0150.04217.90
5.5.170.0140.00815.54
5.5.160.0160.03217.89
5.5.150.0050.04917.97
5.5.140.0100.03717.83
5.5.130.0140.03617.78
5.5.120.0130.02117.84
5.5.110.0150.03317.84
5.5.100.0090.04817.93
5.5.90.0110.04817.86
5.5.80.0150.03717.82
5.5.70.0180.03117.95
5.5.60.0150.03817.92
5.5.50.0110.04517.95
5.5.40.0080.03017.95
5.5.30.0090.04917.95
5.5.20.0140.02917.95
5.5.10.0190.04317.89
5.5.00.0160.04617.91
5.4.450.0160.03917.08
5.4.440.0120.02917.13
5.4.430.0130.04117.13
5.4.420.0130.04017.12
5.4.410.0100.04217.02
5.4.400.0170.03916.88
5.4.390.0110.04216.98
5.4.380.0080.02416.87
5.4.370.0070.02916.98
5.4.360.0110.04616.98
5.4.350.0090.04116.92
5.4.340.0100.04016.85
5.4.330.0080.00814.80
5.4.320.0120.04216.92
5.4.310.0070.03216.92
5.4.300.0140.03916.92
5.4.290.0020.04916.91
5.4.280.0110.02216.92
5.4.270.0040.04817.01
5.4.260.0130.04217.01
5.4.250.0110.04316.97
5.4.240.0080.04516.87
5.4.230.0040.03316.92
5.4.220.0100.04016.96
5.4.210.0120.02716.97
5.4.200.0080.04516.94
5.4.190.0140.03216.96
5.4.180.0150.04216.83
5.4.170.0140.03816.91
5.4.160.0120.03316.84
5.4.150.0120.04016.95
5.4.140.0140.03015.64
5.4.130.0090.04415.59
5.4.120.0100.03915.64
5.4.110.0120.03815.59
5.4.100.0090.03915.62
5.4.90.0130.03515.61
5.4.80.0100.04015.60
5.4.70.0140.04015.59
5.4.60.0080.04215.61
5.4.50.0140.02715.58
5.4.40.0130.04015.57
5.4.30.0140.01915.63
5.4.20.0110.04115.64
5.4.10.0100.04415.58
5.4.00.0090.03115.34
5.3.290.0050.04514.70
5.3.280.0060.04414.73
5.3.270.0070.04214.69
5.3.260.0100.03514.70
5.3.250.0080.04414.74
5.3.240.0130.04414.73
5.3.230.0130.02914.73
5.3.220.0110.04614.74
5.3.210.0170.03614.74
5.3.200.0110.03814.69
5.3.190.0110.04414.72
5.3.180.0090.04514.67
5.3.170.0080.04014.69
5.3.160.0170.03614.72
5.3.150.0090.04314.72
5.3.140.0140.04014.66
5.3.130.0110.04414.71
5.3.120.0150.03414.70
5.3.110.0100.02714.75
5.3.100.0090.02414.39
5.3.90.0110.04614.48
5.3.80.0140.03814.44
5.3.70.0110.03814.48
5.3.60.0080.04214.35
5.3.50.0110.03914.33
5.3.40.0110.03714.42
5.3.30.0130.03914.35
5.3.20.0060.02414.28
5.3.10.0040.03414.20
5.3.00.0130.02514.25

preferences:
35.04 ms | 401 KiB | 5 Q