3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } return $isValid; } $email = 'ses@ed.de'; var_dump(validEmail($email));

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.0100.00718.68
8.3.50.0100.00722.11
8.3.40.0090.00619.15
8.3.30.0110.00419.46
8.3.20.0040.00420.54
8.3.10.0060.00322.36
8.3.00.0040.00422.77
8.2.180.0140.00716.75
8.2.170.0180.00022.96
8.2.160.0140.00721.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0050.00226.16
8.2.120.0040.00419.76
8.2.110.0090.00022.54
8.2.100.0040.01218.22
8.2.90.0050.00319.51
8.2.80.0040.00418.30
8.2.70.0030.00718.13
8.2.60.0050.00318.18
8.2.50.0000.00818.07
8.2.40.0040.00418.59
8.2.30.0000.00818.40
8.2.20.0000.00818.14
8.2.10.0060.00319.88
8.2.00.0050.00218.04
8.1.280.0140.00025.92
8.1.270.0040.00422.31
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0040.00424.00
8.1.230.0070.00419.26
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0060.00317.60
8.1.190.0000.00817.66
8.1.180.0000.00918.10
8.1.170.0080.00018.96
8.1.160.0000.00822.20
8.1.150.0030.00518.89
8.1.140.0030.00617.68
8.1.130.0000.00817.90
8.1.120.0050.00217.69
8.1.110.0000.00717.85
8.1.100.0000.00817.80
8.1.90.0040.00417.70
8.1.80.0040.00417.60
8.1.70.0060.00317.60
8.1.60.0090.00017.84
8.1.50.0030.00517.76
8.1.40.0060.00317.89
8.1.30.0080.00017.86
8.1.20.0080.00017.91
8.1.10.0040.00417.73
8.1.00.0030.00617.76
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0030.00318.51
8.0.270.0000.00717.32
8.0.260.0040.00417.12
8.0.250.0070.00017.20
8.0.240.0000.00817.32
8.0.230.0030.00317.16
8.0.220.0070.00017.11
8.0.210.0060.00317.13
8.0.200.0040.00417.13
8.0.190.0000.00817.07
8.0.180.0000.00717.05
8.0.170.0050.00317.12
8.0.160.0080.00017.08
8.0.150.0000.00817.13
8.0.140.0000.00717.01
8.0.130.0080.00013.66
8.0.120.0030.00617.05
8.0.110.0020.00517.23
8.0.100.0000.00817.16
8.0.90.0000.00817.09
8.0.80.0060.01017.20
8.0.70.0070.00017.15
8.0.60.0070.00017.08
8.0.50.0030.00517.01
8.0.30.0070.01217.26
8.0.20.0060.01517.40
8.0.10.0050.00317.21
8.0.00.0060.01416.92
7.4.330.0050.00015.43
7.4.320.0060.00016.83
7.4.300.0060.00316.80
7.4.290.0000.00817.00
7.4.280.0080.00016.74
7.4.270.0000.00716.86
7.4.260.0090.00016.95
7.4.250.0040.00416.82
7.4.240.0040.00416.85
7.4.230.0040.00416.61
7.4.220.0130.00616.84
7.4.210.0080.00916.89
7.4.200.0000.00717.04
7.4.190.0070.00016.82
7.4.160.0080.00816.96
7.4.150.0000.01717.40
7.4.140.0130.00717.86
7.4.130.0110.01016.87
7.4.120.0060.01216.97
7.4.110.0070.01416.87
7.4.100.0110.00716.91
7.4.90.0170.00016.88
7.4.80.0100.01319.39
7.4.70.0080.00916.93
7.4.60.0070.01116.72
7.4.50.0000.00916.87
7.4.40.0120.00322.77
7.4.30.0160.00716.75
7.4.00.0060.00915.27
7.3.330.0080.00013.69
7.3.320.0000.00613.50
7.3.310.0000.00716.71
7.3.300.0030.00516.63
7.3.290.0060.00916.64
7.3.280.0040.01116.63
7.3.270.0090.00917.40
7.3.260.0090.01516.69
7.3.250.0090.01216.80
7.3.240.0090.00916.82
7.3.230.0140.00416.52
7.3.210.0100.01016.85
7.3.200.0130.01019.39
7.3.190.0060.01216.59
7.3.180.0090.00616.63
7.3.170.0070.01116.89
7.3.160.0140.00716.88
7.3.120.0060.01015.09
7.2.330.0070.01016.95
7.2.320.0100.01416.96
7.2.310.0090.00916.86
7.2.300.0130.00716.82
7.2.290.0090.00616.83
7.2.80.0060.00616.71
7.2.60.0090.00316.89
7.2.00.0040.01119.54
7.1.200.0040.00716.02
7.1.100.0000.01218.67
7.1.70.0000.00817.47
7.1.60.0040.01819.82
7.1.50.0130.01016.97
7.1.00.0100.06722.53
7.0.200.0120.00317.08
7.0.140.0070.06722.25
7.0.60.0070.08720.08
7.0.50.0070.04318.01
7.0.40.0100.08720.21
7.0.30.0300.04020.26
7.0.20.0200.06020.22
7.0.10.0270.08720.34
7.0.00.0070.08720.27
5.6.280.0030.07320.93
5.6.210.0070.08020.66
5.6.200.0100.08318.20
5.6.190.0000.06020.50
5.6.180.3600.04720.71
5.6.170.0300.08020.58
5.6.160.0070.05320.66
5.6.150.0100.04318.24
5.6.140.0070.06318.27
5.6.130.0100.08318.30
5.6.120.0070.05721.07
5.6.110.0030.04321.20
5.6.100.0100.07721.21
5.6.90.0030.08321.15
5.6.80.0130.08320.45
5.6.70.0370.06320.57
5.5.350.0030.08320.56
5.5.340.0000.05718.14
5.5.330.0030.04720.48
5.5.320.0300.03720.34
5.5.310.0270.04020.31
5.5.300.0000.04318.07
5.5.290.0100.07718.07
5.5.280.0030.07020.80
5.5.270.0230.08020.89
5.5.260.0100.08720.93
5.5.250.0100.08320.73
5.5.240.0100.06020.23
5.4.450.0200.06019.78
5.4.440.0730.04319.56
5.4.430.0100.06319.54
5.4.420.0100.05319.64
5.4.410.0070.05719.29
5.4.400.1570.00018.90
5.4.390.1600.00018.86
5.4.380.0270.05318.70
5.4.370.0230.04318.85
5.4.360.0130.05318.88
5.4.350.0200.05318.85
5.4.340.0130.05318.83
5.4.320.0090.03912.57
5.4.310.0100.03512.57
5.4.300.0080.03712.57
5.4.290.0070.05212.57
5.4.280.0120.03812.46
5.4.270.0130.05719.14
5.4.260.0230.06319.00
5.4.250.0030.08018.89
5.4.240.0070.05718.77
5.4.230.0130.05019.13
5.4.220.0170.05319.10
5.4.210.0000.06719.03
5.4.200.0130.04719.04
5.4.190.0030.05719.06
5.4.180.0100.05719.10
5.4.170.0070.05318.84
5.4.160.0100.05019.10
5.4.150.0100.07019.04
5.4.140.0070.05016.72
5.4.130.0100.04716.69
5.4.120.0100.04716.69
5.4.110.0100.05316.55
5.4.100.0030.06316.55
5.4.90.0130.04316.69
5.4.80.0130.04716.51
5.4.70.0070.05016.60
5.4.60.0100.06716.48
5.4.50.0100.05716.55
5.4.40.0100.06016.48
5.4.30.0100.04716.62
5.4.20.0030.05016.56
5.4.10.0200.04016.52
5.4.00.0170.04015.93
5.3.290.0060.04712.83
5.3.280.0130.04714.72
5.3.270.0070.06014.63
5.3.260.0200.04714.87
5.3.250.0000.06014.73
5.3.240.0130.05014.73
5.3.230.0200.06014.72
5.3.220.0030.05314.79
5.3.210.0070.07714.63
5.3.200.0170.06314.58
5.3.190.0130.06314.69
5.3.180.0170.05014.78
5.3.170.0100.04714.68
5.3.160.0030.05314.69
5.3.150.0100.05014.66
5.3.140.0070.07314.73
5.3.130.0130.05014.72
5.3.120.0070.06014.42
5.3.110.0030.06314.66
5.3.100.0030.05314.08
5.3.90.0070.05014.14
5.3.80.0030.05314.13
5.3.70.0200.05714.06
5.3.60.0030.05314.06
5.3.50.0070.05314.01
5.3.40.0100.04714.07
5.3.30.0100.07013.94
5.3.20.0200.05313.82
5.3.10.0100.05013.91
5.3.00.0130.06013.70
5.2.170.0100.05311.27
5.2.160.0030.05711.01
5.2.150.0030.04311.09
5.2.140.0100.04011.25
5.2.130.0000.04311.21
5.2.120.0170.03711.13
5.2.110.0100.03711.13
5.2.100.0070.04011.21
5.2.90.0100.05711.14
5.2.80.0070.04011.20
5.2.70.0030.04311.03
5.2.60.0100.05311.17
5.2.50.0100.04011.03
5.2.40.0170.03011.04
5.2.30.0030.04710.98
5.2.20.0100.03710.99
5.2.10.0000.05310.87
5.2.00.0030.05710.83
5.1.60.0000.03710.09
5.1.50.0030.03710.09
5.1.40.0070.0379.97
5.1.30.0070.05010.27
5.1.20.0100.04310.48
5.1.10.0030.04010.36
5.1.00.0170.04010.21
5.0.50.0100.0378.58
5.0.40.0100.0308.56
5.0.30.0030.0438.33
5.0.20.0030.0278.28
5.0.10.0030.0408.23
5.0.00.0070.0378.30
4.4.90.0100.0207.07
4.4.80.0070.0277.07
4.4.70.0030.0207.07
4.4.60.0030.0207.07
4.4.50.0070.0177.07
4.4.40.0030.0437.07
4.4.30.0030.0207.07
4.4.20.0000.0277.07
4.4.10.0100.0237.07
4.4.00.0030.0477.07
4.3.110.0030.0307.07
4.3.100.0070.0177.07
4.3.90.0000.0237.07
4.3.80.0070.0307.07
4.3.70.0070.0177.07
4.3.60.0030.0207.07
4.3.50.0030.0237.07
4.3.40.0030.0437.07
4.3.30.0030.0237.07
4.3.20.0070.0207.07
4.3.10.0030.0207.07
4.3.00.0130.0207.19

preferences:
39.21 ms | 401 KiB | 5 Q