3v4l.org

run code in 300+ PHP versions simultaneously
<?php class customException extends Exception { public function error_message() { //error message $error_msg = 'Error caught on line '.$this->getLine().' in '.$this->getFile() .': <b>'.$this->getMessage().'</b> is no valid E-Mail address'; return $error_msg; } } $email = "someonesomeone@example.com"; try { //check if if(filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) { //throwing an exception in case email is not valid throw new customException($email); } //checking for "example" in mail address if(strpos($email, "example") !== FALSE) { throw new Exception("$email contains'example'"); } } catch (customException $e) { echo $e->error_message(); } 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.60.0040.01217.25
8.3.50.0100.01016.81
8.3.40.0100.01019.29
8.3.30.0130.00319.20
8.3.20.0040.00424.18
8.3.10.0090.00024.66
8.3.00.0050.00326.16
8.2.180.0100.01325.92
8.2.170.0130.00719.43
8.2.160.0060.01022.96
8.2.150.0030.00525.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00826.35
8.2.110.0070.00321.33
8.2.100.0030.01018.22
8.2.90.0080.00018.41
8.2.80.0100.00018.25
8.2.70.0030.01018.18
8.2.60.0000.01018.47
8.2.50.0030.00618.10
8.2.40.0040.00421.29
8.2.30.0060.00319.57
8.2.20.0000.00818.45
8.2.10.0000.00819.54
8.2.00.0060.00319.54
8.1.280.0140.00725.92
8.1.270.0080.00024.35
8.1.260.0130.00728.09
8.1.250.0080.00028.09
8.1.240.0090.00024.35
8.1.230.0060.00623.00
8.1.220.0050.00318.03
8.1.210.0040.00719.01
8.1.200.0050.00517.73
8.1.190.0070.00317.75
8.1.180.0000.00818.10
8.1.170.0040.00419.15
8.1.160.0040.00419.22
8.1.150.0000.00819.20
8.1.140.0030.00519.14
8.1.130.0040.00420.34
8.1.120.0030.00617.73
8.1.110.0040.00717.76
8.1.100.0030.00517.83
8.1.90.0040.00417.70
8.1.80.0030.00817.68
8.1.70.0000.00817.72
8.1.60.0060.00317.81
8.1.50.0030.01017.91
8.1.40.0000.00817.86
8.1.30.0050.00318.04
8.1.20.0060.00317.84
8.1.10.0040.00417.80
8.1.00.0040.00719.79
8.0.300.0000.00820.36
8.0.290.0050.00517.25
8.0.280.0000.00718.56
8.0.270.0040.00417.22
8.0.260.0030.00618.64
8.0.250.0030.00617.40
8.0.240.0000.00817.34
8.0.230.0070.00017.23
8.0.220.0050.00317.33
8.0.210.0030.00617.29
8.0.200.0060.00317.28
8.0.190.0030.00617.35
8.0.180.0040.00417.24
8.0.170.0060.00317.31
8.0.160.0000.00817.31
8.0.150.0050.00317.23
8.0.140.0040.00417.11
8.0.130.0000.00613.71
8.0.120.0050.00317.22
8.0.110.0080.00017.22
8.0.100.0040.00417.18
8.0.90.0000.00817.37
8.0.80.0080.01017.30
8.0.70.0040.00417.25
8.0.60.0040.00417.13
8.0.50.0000.00817.16
8.0.30.0210.01517.26
8.0.20.0140.01717.30
8.0.10.0240.02117.29
8.0.00.0200.01617.35
7.4.330.0030.00315.55
7.4.320.0000.00716.87
7.4.300.0000.00716.97
7.4.290.0000.00717.00
7.4.280.0000.00816.97
7.4.270.0040.00417.10
7.4.260.0000.00713.74
7.4.250.0000.00717.00
7.4.240.0020.00516.89
7.4.230.0070.00017.10
7.4.220.0040.00416.92
7.4.210.0040.01217.03
7.4.200.0000.00717.07
7.4.160.0140.01416.94
7.4.150.0200.01416.92
7.4.140.0250.01516.75
7.4.130.0240.01216.93
7.4.120.0200.01216.90
7.4.110.0280.00616.74
7.4.100.0210.01516.80
7.4.90.0220.00716.93
7.4.80.0300.00616.92
7.4.70.0110.01616.91
7.4.60.0300.00816.89
7.4.50.0250.00916.80
7.4.40.0250.01216.69
7.4.30.0590.01116.73
7.4.20.0350.00416.88
7.4.10.0190.02016.84
7.4.00.0190.01116.76
7.3.330.0050.00216.64
7.3.320.0000.00613.73
7.3.310.0020.00516.70
7.3.300.0040.00416.76
7.3.290.0060.00916.74
7.3.280.0060.01316.68
7.3.270.0220.00516.70
7.3.260.0240.00416.69
7.3.250.0250.00316.65
7.3.240.0290.00516.73
7.3.230.0180.01716.69
7.3.220.0280.00916.64
7.3.210.0230.01216.63
7.3.200.0180.01316.56
7.3.190.0300.01316.59
7.3.180.0250.01416.59
7.3.170.0250.00616.54
7.3.160.0310.00716.66
7.3.150.0190.01316.58
7.3.140.0250.01016.63
7.3.130.0190.01116.66
7.3.120.0180.01116.55
7.3.110.0240.00816.43
7.3.100.0150.01516.44
7.3.90.0520.00916.84
7.3.80.0300.00916.64
7.3.70.0290.01316.76
7.3.60.0380.01116.65
7.3.50.0280.00316.74
7.3.40.0240.00316.66
7.3.30.0250.00616.66
7.3.20.0230.00916.79
7.3.10.0180.01316.66
7.3.00.0280.01316.53

preferences:
64.57 ms | 400 KiB | 5 Q