3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('log_errors','off'); // log_errors_max_len = infinite length ini_set("log_errors_max_len",0); function long_exception_handler($exception) { // for compatibility, call __toString echo $exception->__toString(); } set_exception_handler('long_exception_handler'); /** * 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.0130.00617.00
8.3.50.0120.00721.94
8.3.40.0080.00818.71
8.3.30.0070.00719.14
8.3.20.0080.00020.01
8.3.10.0000.00823.64
8.3.00.0070.00317.50
8.2.180.0060.01518.41
8.2.170.0070.00722.96
8.2.160.0090.00620.57
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00022.25
8.2.110.0090.00022.15
8.2.100.0060.00617.91
8.2.90.0040.00419.03
8.2.80.0050.00317.97
8.2.70.0090.00017.63
8.2.60.0080.00017.91
8.2.50.0080.00018.07
8.2.40.0080.00018.16
8.2.30.0030.00518.14
8.2.20.0000.00717.71
8.2.10.0040.00418.07
8.2.00.0040.00417.72
8.1.280.0040.01825.92
8.1.270.0150.00023.97
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0080.00823.96
8.1.230.0040.00819.16
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0060.00317.48
8.1.190.0000.00817.76
8.1.180.0080.00018.10
8.1.170.0050.00318.77
8.1.160.0000.00722.07
8.1.150.0000.01018.64
8.1.140.0030.00517.50
8.1.130.0030.00317.84
8.1.120.0000.00817.57
8.1.110.0040.00417.52
8.1.100.0000.00717.48
8.1.90.0070.00317.56
8.1.80.0030.00617.53
8.1.70.0030.00317.39
8.1.60.0030.00617.68
8.1.50.0000.00817.47
8.1.40.0030.00517.64
8.1.30.0000.00817.63
8.1.20.0040.00417.68
8.1.10.0000.00717.67
8.1.00.0030.00517.56
8.0.300.0080.00318.77
8.0.290.0040.00417.03
8.0.280.0080.00018.47
8.0.270.0040.00417.21
8.0.260.0040.00417.25
8.0.250.0030.00316.91
8.0.240.0030.00317.03
8.0.230.0030.00616.90
8.0.220.0000.00716.94
8.0.210.0060.00316.95
8.0.200.0030.00617.05
8.0.190.0040.00416.84
8.0.180.0000.00716.94
8.0.170.0080.00016.84
8.0.160.0050.00216.84
8.0.150.0050.00316.84
8.0.140.0040.00416.95
8.0.130.0030.00313.50
8.0.120.0040.00416.87
8.0.110.0040.00417.01
8.0.100.0000.00717.05
8.0.90.0040.00416.93
8.0.80.0000.01517.03
8.0.70.0000.00716.79
8.0.60.0040.00416.93
8.0.50.0000.00817.07
8.0.30.0090.00917.31
8.0.20.0130.00617.40
8.0.10.0040.00417.16
8.0.00.0130.00416.69
7.4.330.0050.00015.00
7.4.320.0000.00616.71
7.4.300.0030.00316.64
7.4.290.0020.00516.66
7.4.280.0030.00316.61
7.4.270.0070.00016.54
7.4.260.0030.00316.65
7.4.250.0040.00416.58
7.4.240.0000.00716.61
7.4.230.0030.00516.50
7.4.220.0070.01116.60
7.4.210.0060.01116.65
7.4.200.0050.00316.68
7.4.190.0000.00716.46
7.4.160.0070.01316.79
7.4.150.0090.01517.40
7.4.140.0090.00817.86
7.4.130.0100.00616.61
7.4.120.0060.01116.71
7.4.110.0100.00616.56
7.4.100.0100.01016.54
7.4.90.0090.00916.68
7.4.80.0070.01519.39
7.4.70.0070.01016.50
7.4.60.0130.00316.62
7.4.50.0050.00016.34
7.4.40.0030.00922.77
7.4.30.0070.01016.60
7.4.00.0070.00715.17
7.3.330.0000.00513.18
7.3.320.0030.00313.45
7.3.310.0040.00416.21
7.3.300.0040.00416.27
7.3.290.0120.00416.37
7.3.280.0080.01116.38
7.3.270.0130.00417.40
7.3.260.0060.01216.66
7.3.250.0140.00716.53
7.3.240.0200.00316.39
7.3.230.0070.01016.42
7.3.210.0140.00616.54
7.3.200.0110.01119.39
7.3.190.0130.00716.51
7.3.180.0030.01416.31
7.3.170.0120.00416.50
7.3.160.0090.00616.51
7.3.120.0070.00715.06
7.3.110.0070.01114.94
7.3.100.0060.00614.75
7.3.90.0030.01015.04
7.3.80.0090.00314.64
7.3.70.0070.00414.85
7.3.60.0000.00814.68
7.3.50.0070.00314.46
7.3.40.0030.01314.75
7.3.30.0070.01014.64
7.3.20.0070.00716.46
7.3.10.0070.00316.69
7.3.00.0100.00616.44
7.2.330.0070.01016.68
7.2.320.0090.01516.69
7.2.310.0060.01016.59
7.2.300.0100.00716.69
7.2.290.0100.01016.43
7.2.240.0060.00615.21
7.2.230.0100.00615.01
7.2.220.0040.00715.06
7.2.210.0030.01015.09
7.2.200.0060.01015.03
7.2.190.0060.00915.22
7.2.180.0110.00414.93
7.2.170.0030.01315.09
7.2.160.0130.00315.02
7.2.150.0070.01116.74
7.2.140.0030.01216.94
7.2.130.0060.00916.77
7.2.120.0030.01016.66
7.2.110.0080.00816.90
7.2.100.0070.01016.71
7.2.90.0070.00716.78
7.2.80.0060.00617.04
7.2.70.0030.01116.99
7.2.60.0060.00816.98
7.2.50.0080.00316.63
7.2.40.0060.00916.70
7.2.30.0040.00716.99
7.2.20.0060.00916.87
7.2.10.0160.00016.98
7.2.00.0030.01118.22
7.1.330.0070.00715.59
7.1.320.0140.00015.48
7.1.310.0100.00315.73
7.1.300.0060.00815.88
7.1.290.0000.01415.80
7.1.280.0080.00415.73
7.1.270.0070.00715.64
7.1.260.0100.00315.93
7.1.250.0030.00715.78
7.1.100.0030.00918.07
7.1.70.0000.00717.11
7.1.60.0090.01219.33
7.1.50.0070.01016.81
7.1.00.0000.08022.45
7.0.200.0100.00316.87
7.0.140.0000.07721.95
7.0.100.0030.04319.99
7.0.90.0170.06719.91
7.0.80.0070.03719.91
7.0.70.0200.04320.14
7.0.60.0130.08019.94
7.0.50.0270.06720.27
7.0.40.0200.07020.08
7.0.30.0100.07720.18
7.0.20.0130.07720.04
7.0.10.0100.08320.14
7.0.00.0030.08720.16
5.6.280.0100.06721.05
5.6.250.0070.03720.64
5.6.240.0070.08020.52
5.6.230.0170.04320.55
5.6.220.0030.08720.68
5.6.210.0130.06720.46
5.6.200.0100.04321.11
5.6.190.0130.07721.18
5.6.180.0100.04721.11
5.6.170.0070.04721.09
5.6.160.0130.06720.96
5.6.150.0230.06021.18
5.6.140.0130.06020.94
5.6.130.0070.07321.02
5.6.120.0070.05021.08
5.6.110.0030.08320.94
5.6.100.0030.06321.11
5.6.90.0170.07320.96
5.6.80.0100.07720.34
5.6.70.0070.08320.49
5.6.60.0130.07020.49
5.6.50.0070.08020.48
5.6.40.0100.03720.45
5.6.30.0170.07020.32
5.6.20.0100.07720.41
5.6.10.0130.04320.42
5.6.00.0030.08320.29
5.5.380.0070.04020.40
5.5.370.0100.08020.43
5.5.360.0100.07720.57
5.5.350.0000.05320.43
5.5.340.0130.07720.77
5.5.330.0130.05020.84
5.5.320.0200.06720.91
5.5.310.0130.06320.86
5.5.300.0130.04720.74
5.5.290.0130.08320.88
5.5.280.0070.05320.94
5.5.270.0100.08320.91
5.5.260.0130.08020.93
5.5.250.0130.08020.56
5.5.240.0100.04720.31
5.5.230.0100.04720.12
5.5.220.0030.08320.19
5.5.210.0100.04320.29
5.5.200.0070.08320.14
5.5.190.0070.07320.10
5.5.180.0130.07320.26
5.5.160.0170.07320.23
5.5.150.0100.07320.25
5.5.140.0030.08020.29
5.5.130.0170.06720.00
5.5.120.0100.06720.16
5.5.110.0100.08020.24
5.5.100.0070.08020.18
5.5.90.0070.07719.91
5.5.80.0170.06320.18
5.5.70.0130.07320.10
5.5.60.0070.07319.98
5.5.50.0070.07020.15
5.5.40.0100.08020.01
5.5.30.0100.05020.05
5.5.20.0100.07320.11
5.5.10.0070.08320.08
5.5.00.0070.05320.13
5.4.450.0100.08019.20
5.4.440.0030.08019.49
5.4.430.0030.06319.36
5.4.420.0070.07719.48
5.4.410.0070.07719.32
5.4.400.0030.07719.07
5.4.390.0130.08019.04
5.4.380.0070.06719.03
5.4.370.0100.07019.13
5.4.360.0070.07019.16
5.4.350.0100.07019.04
5.4.340.0030.08718.93
5.4.320.0000.05319.05
5.4.310.0130.05019.18
5.4.300.0070.04319.20
5.4.290.0100.07019.12
5.4.280.0030.07319.19
5.4.270.0100.07019.14
5.4.260.0130.03319.12
5.4.250.0030.04718.94
5.4.240.0030.04019.13
5.4.230.0170.03319.02
5.4.220.0100.07019.12
5.4.210.0230.06318.87
5.4.200.0000.05019.20
5.4.190.0100.07718.93
5.4.180.0030.04719.03
5.4.170.0030.04718.86
5.4.160.0130.06719.14
5.4.150.0100.07319.21
5.4.140.0130.04316.50
5.4.130.0030.06016.46
5.4.120.0030.07316.50
5.4.110.0030.08016.58
5.4.100.0100.07316.56
5.4.90.0100.07016.54
5.4.80.0130.06716.54
5.4.70.0030.07316.47
5.4.60.0100.07316.30
5.4.50.0030.06316.37
5.4.40.0100.07316.50
5.4.30.0100.07016.44
5.4.20.0130.05316.48
5.4.10.0070.06716.36
5.4.00.0030.04015.78
5.3.290.0100.06014.74
5.3.280.0030.05314.74
5.3.270.0000.05714.76
5.3.260.0200.06714.57
5.3.250.0170.04014.73
5.3.240.0070.07714.73
5.3.230.0070.06314.61
5.3.220.0100.04014.53
5.3.210.0030.07014.53
5.3.200.0100.07314.50
5.3.190.0070.07714.57
5.3.180.0070.07314.56
5.3.170.0130.07014.68
5.3.160.0030.05014.63
5.3.150.0070.07714.60
5.3.140.0030.07014.53
5.3.130.0100.05714.57
5.3.120.0070.07314.67
5.3.110.0100.07714.52
5.3.100.0130.03314.14
5.3.90.0100.07313.98
5.3.80.0070.04313.96
5.3.70.0070.03714.04
5.3.60.0030.07714.00
5.3.50.0070.03713.89
5.3.40.0100.07013.86
5.3.30.0100.07013.94
5.3.20.0070.07313.77
5.3.10.0170.07313.57
5.3.00.0070.04313.54
5.2.170.0030.06311.16
5.2.160.0070.06011.14
5.2.150.0170.05311.18
5.2.140.0100.06011.27
5.2.130.0030.06311.25
5.2.120.0070.06011.02
5.2.110.0070.04311.04
5.2.100.0000.06311.06
5.2.90.0030.05311.10
5.2.80.0070.05011.24
5.2.70.0030.03011.24
5.2.60.0030.04011.01
5.2.50.0070.03310.98
5.2.40.0070.02711.07
5.2.30.0100.05310.89
5.2.20.0100.05310.90
5.2.10.0130.05010.86
5.2.00.0000.06310.75
5.1.60.0070.0509.85
5.1.50.0030.0509.89
5.1.40.0030.04710.00
5.1.30.0030.04310.38
5.1.20.0000.05310.43
5.1.10.0100.05010.15
5.1.00.0000.04310.13
5.0.50.0070.0438.56
5.0.40.0000.0338.51
5.0.30.0070.0608.51
5.0.20.0070.0178.51
5.0.10.0000.0478.51
5.0.00.0030.0538.51
4.4.90.0030.0338.51
4.4.80.0100.0238.51
4.4.70.0030.0278.51
4.4.60.0000.0338.51
4.4.50.0070.0278.51
4.4.40.0030.0538.51
4.4.30.0070.0308.51
4.4.20.0070.0178.51
4.4.10.0100.0178.51
4.4.00.0070.0478.51
4.3.110.0000.0378.51
4.3.100.0030.0378.51
4.3.90.0100.0278.51
4.3.80.0000.0308.51
4.3.70.0070.0308.51
4.3.60.0070.0208.51
4.3.50.0030.0338.51
4.3.40.0000.0508.51
4.3.30.0030.0338.51
4.3.20.0000.0208.51
4.3.10.0000.0338.51
4.3.00.0000.0378.51

preferences:
44.41 ms | 401 KiB | 5 Q