3v4l.org

run code in 300+ PHP versions simultaneously
<?php class customException extends Exception { public function errorMessage() { //error message $errorMsg = 'Error on line '.$this->getLine().' in '.$this->getFile() .': <b>'.$this->getMessage().'</b> is not a valid E-Mail address'; return $errorMsg; } } $email = "someone@example.com"; try { //check if if(filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) { //throw exception if email is not valid throw new customException($email); } //check for "example" in mail address if(strpos($email, "example") !== FALSE) { throw new Exception("$email is an example e-mail"); } } catch (customException $e) { echo $e->errorMessage(); } catch(Exception $e) { echo $e->getMessage(); }

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.70.0130.00717.13
8.3.60.0180.00418.90
8.3.50.0140.00922.20
8.3.40.0060.00919.27
8.3.30.0130.00919.32
8.3.20.0000.00820.60
8.3.10.0040.00421.04
8.3.00.0030.00619.93
8.2.180.0150.00317.00
8.2.170.0120.00322.96
8.2.160.0040.01120.89
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00422.49
8.2.110.0040.00721.13
8.2.100.0080.00418.28
8.2.90.0000.00819.55
8.2.80.0080.00018.13
8.2.70.0080.00018.25
8.2.60.0040.00418.24
8.2.50.0060.00318.13
8.2.40.0050.00318.30
8.2.30.0040.00419.53
8.2.20.0000.00818.07
8.2.10.0000.00818.37
8.2.00.0080.00018.13
8.1.280.0060.01225.92
8.1.270.0060.00324.09
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0000.01318.27
8.1.230.0040.00819.32
8.1.220.0050.00318.02
8.1.210.0080.00018.77
8.1.200.0070.00417.86
8.1.190.0050.00517.72
8.1.180.0030.00518.10
8.1.170.0000.01218.86
8.1.160.0040.00422.15
8.1.150.0030.00519.16
8.1.140.0040.00417.76
8.1.130.0000.00818.07
8.1.120.0030.00517.82
8.1.110.0050.00317.70
8.1.100.0050.00317.82
8.1.90.0050.00317.84
8.1.80.0040.00417.63
8.1.70.0040.00417.74
8.1.60.0060.00317.94
8.1.50.0040.00417.86
8.1.40.0030.00517.73
8.1.30.0030.00617.93
8.1.20.0050.00317.98
8.1.10.0000.00817.93
8.1.00.0080.00419.87
8.0.300.0030.00520.34
8.0.290.0030.00617.13
8.0.280.0040.00418.61
8.0.270.0040.00417.20
8.0.260.0040.00417.50
8.0.250.0040.00417.36
8.0.240.0050.00317.31
8.0.230.0030.00517.41
8.0.220.0030.00517.38
8.0.210.0000.00717.14
8.0.200.0030.00517.19
8.0.190.0030.00617.30
8.0.180.0040.00417.20
8.0.170.0030.00617.34
8.0.160.0040.00417.29
8.0.150.0040.00417.12
8.0.140.0030.00617.15
8.0.130.0030.00313.75
8.0.120.0040.00417.31
8.0.110.0000.00917.32
8.0.100.0030.00517.32
8.0.90.0000.00817.34
8.0.80.0100.00717.39
8.0.70.0000.00817.17
8.0.60.0000.00817.22
8.0.50.0000.00817.25
8.0.30.0080.01617.34
8.0.20.0150.01217.43
8.0.10.0030.00617.30
8.0.00.0050.01417.30
7.4.330.0030.00315.30
7.4.320.0000.00717.10
7.4.300.0030.00317.05
7.4.290.0000.00716.96
7.4.280.0030.00617.05
7.4.270.0000.00716.87
7.4.260.0030.00616.84
7.4.250.0080.00016.85
7.4.240.0040.00416.97
7.4.230.0070.00017.05
7.4.220.0120.00916.99
7.4.210.0140.00716.98
7.4.200.0080.00016.76
7.4.160.0080.01116.86
7.4.150.0040.01617.40
7.4.140.0140.00517.86
7.4.130.0080.00917.06
7.4.120.0050.01316.86
7.4.110.0090.00917.02
7.4.100.0060.01217.01
7.4.90.0060.01316.94
7.4.80.0120.00916.71
7.4.70.0150.00916.91
7.4.60.0140.00316.99
7.4.50.0030.00616.63
7.4.40.0060.01216.84
7.4.30.0090.00916.97
7.4.00.0070.01115.47
7.3.330.0000.00713.68
7.3.320.0060.00013.68
7.3.310.0030.00616.80
7.3.300.0020.00516.68
7.3.290.0120.00316.77
7.3.280.0080.01016.73
7.3.270.0130.00717.40
7.3.260.0100.01716.95
7.3.250.0070.01316.89
7.3.240.0070.01116.82
7.3.230.0090.00916.90
7.3.210.0090.01016.89
7.3.200.0080.01119.39
7.3.190.0040.01316.87
7.3.180.0150.00817.00
7.3.170.0080.00816.77
7.3.160.0130.00317.04
7.2.330.0060.01516.97
7.2.320.0100.01016.77
7.2.310.0160.00316.74
7.2.300.0130.00916.95
7.2.290.0100.01316.80
7.2.00.0120.01219.64
7.1.100.0070.01018.66
7.1.70.0000.00917.43
7.1.60.0110.01419.32
7.1.50.0070.02017.53
7.1.00.0070.07322.54
7.0.200.0030.00517.21
7.0.140.0130.06322.18
7.0.100.0130.04320.24
7.0.90.0030.08720.16
7.0.80.0070.07720.20
7.0.70.0030.07320.13
7.0.60.0100.07020.21
7.0.50.0000.07320.66
7.0.40.0130.04720.30
7.0.30.0000.08020.21
7.0.20.0070.08020.36
7.0.10.0100.05020.30
7.0.00.0130.08320.33
5.6.250.0000.09020.61
5.6.240.0100.07720.76
5.6.230.0100.05720.71
5.6.220.0070.07020.64
5.6.210.0100.04320.77
5.6.200.0030.08021.08
5.6.190.0030.04321.05
5.6.180.0100.07721.16
5.6.170.0070.04320.99
5.6.160.0030.07020.99
5.6.150.0030.09321.14
5.6.140.0100.07021.04
5.6.130.0170.07020.95
5.6.120.0100.08321.08
5.6.110.0070.05020.95
5.6.100.0100.08021.02
5.6.90.0070.08021.04
5.6.80.0100.07720.52
5.6.70.0130.03020.45
5.6.60.0030.03720.41
5.6.50.0070.08020.49
5.6.40.0030.08020.48
5.6.30.0070.08020.52
5.6.20.0100.08020.33
5.6.10.0070.07020.41
5.6.00.0100.07320.38
5.5.380.0030.07720.52
5.5.370.0130.07020.48
5.5.360.0270.03320.37
5.5.350.0200.06720.48
5.5.340.0000.08720.92
5.5.330.0170.07320.86
5.5.320.0030.07020.81
5.5.310.0070.08320.66
5.5.300.0030.09020.95
5.5.290.0070.08020.82
5.5.280.0070.07320.76
5.5.270.0130.07020.85
5.5.260.0000.08020.91
5.5.250.0130.05020.66
5.5.240.0100.05320.28
5.5.230.0170.06720.34
5.5.220.0030.07020.18
5.5.210.0000.09020.21
5.5.200.0000.08320.22
5.5.190.0070.07720.24
5.5.180.0100.07320.11
5.5.160.0070.08320.14
5.5.150.0130.05020.18
5.5.140.0070.07320.11
5.5.130.0030.05720.23
5.5.120.0100.07020.17
5.5.110.0100.08020.24
5.5.100.0130.08020.11
5.5.90.0000.07020.15
5.5.80.0130.07019.99
5.5.70.0130.07320.18
5.5.60.0130.06720.12
5.5.50.0100.07720.18
5.5.40.0100.03720.13
5.5.30.0030.08020.19
5.5.20.0100.07320.12
5.5.10.0100.04320.05
5.5.00.0100.06720.10
5.4.450.0030.05719.54
5.4.440.0100.05319.27
5.4.430.0000.08319.39
5.4.420.0200.03719.39
5.4.410.0170.05719.39
5.4.400.0100.07718.95
5.4.390.0100.06019.26
5.4.380.0130.06319.08
5.4.370.0030.06019.10
5.4.360.0070.03319.27
5.4.350.0100.06319.00
5.4.340.0100.07319.11
5.4.320.0100.06019.24
5.4.310.0100.08019.10
5.4.300.0030.08019.01
5.4.290.0070.07719.08
5.4.280.0100.06719.09
5.4.270.0030.07719.08
5.4.260.0070.07019.08
5.4.250.0000.07319.26
5.4.240.0000.07719.14
5.4.230.0100.06719.10
5.4.220.0070.06719.25
5.4.210.0170.06318.90
5.4.200.0000.04718.98
5.4.190.0130.06719.29
5.4.180.0070.07319.23
5.4.170.0100.06719.29
5.4.160.0130.06718.91
5.4.150.0070.07019.12
5.4.140.0070.07016.47
5.4.130.0200.06016.41
5.4.120.0100.07316.42
5.4.110.0030.06016.51
5.4.100.0070.07016.51
5.4.90.0130.07016.40
5.4.80.0100.06716.27
5.4.70.0030.04316.46
5.4.60.0100.07316.47
5.4.50.0130.06316.45
5.4.40.0030.06016.43
5.4.30.0030.03716.25
5.4.20.0030.03316.34
5.4.10.0070.07016.41
5.4.00.0100.07315.90
5.3.290.0030.08314.82
5.3.280.0070.07014.71
5.3.270.0130.06714.81
5.3.260.0070.08014.59
5.3.250.0000.06714.56
5.3.240.0100.07014.72
5.3.230.0070.07014.59
5.3.220.0030.04714.73
5.3.210.0130.05714.61
5.3.200.0030.07314.64
5.3.190.0170.06714.64
5.3.180.0100.07714.70
5.3.170.0130.03314.74
5.3.160.0070.07014.77
5.3.150.0100.04014.59
5.3.140.0030.07014.57
5.3.130.0030.07014.65
5.3.120.0070.05714.72
5.3.110.0030.07714.74
5.3.100.0030.08014.13
5.3.90.0070.07314.04
5.3.80.0070.03314.02
5.3.70.0130.06014.11
5.3.60.0030.06314.13
5.3.50.0030.07313.93
5.3.40.0070.08014.04
5.3.30.0030.07313.90
5.3.20.0030.05013.70
5.3.10.0130.04713.58
5.3.00.0170.06313.65
5.2.170.0030.04311.23
5.2.160.0030.03311.27
5.2.150.0030.06311.23
5.2.140.0030.03311.11
5.2.130.0030.06311.00
5.2.120.0070.06011.00
5.2.110.0070.06011.11
5.2.100.0070.06010.98
5.2.90.0070.04711.16
5.2.80.0030.04011.21
5.2.70.0070.04711.23
5.2.60.0030.03711.10
5.2.50.0030.06311.08
5.2.40.0070.04711.13
5.2.30.0030.06310.89
5.2.20.0070.06310.90
5.2.10.0000.04310.98
5.2.00.0100.05010.78
5.1.60.0030.02710.46
5.1.50.0100.04710.46
5.1.40.0030.05310.46
5.1.30.0170.04710.46
5.1.20.0100.05310.46
5.1.10.0070.04010.46
5.1.00.0130.02310.46
5.0.50.0000.02710.46
5.0.40.0070.04010.46
5.0.30.0000.06010.46
5.0.20.0070.04010.46
5.0.10.0030.04310.46
5.0.00.0070.03310.46
4.4.90.0070.02710.46
4.4.80.0070.03010.46
4.4.70.0000.02010.46
4.4.60.0000.03710.46
4.4.50.0000.03010.46
4.4.40.0000.03310.46
4.4.30.0000.02010.46
4.4.20.0000.03310.46
4.4.10.0000.03010.46
4.4.00.0070.05310.46
4.3.110.0000.04010.46
4.3.100.0070.03010.46
4.3.90.0000.02710.46
4.3.80.0030.04710.46
4.3.70.0030.02310.46
4.3.60.0030.02310.46
4.3.50.0000.03710.46
4.3.40.0000.05710.46
4.3.30.0030.03310.46
4.3.20.0000.04010.46
4.3.10.0070.02010.46
4.3.00.0070.02310.46

preferences:
39.13 ms | 401 KiB | 5 Q