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 = 's+s@ged.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.0140.00718.65
8.3.50.0130.00722.18
8.3.40.0140.00719.17
8.3.30.0110.00419.27
8.3.20.0040.00420.68
8.3.10.0080.00022.39
8.3.00.0080.00022.84
8.2.180.0070.00716.88
8.2.170.0120.00622.96
8.2.160.0070.00721.37
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.86
8.2.110.0060.00322.40
8.2.100.0140.00318.22
8.2.90.0080.00019.59
8.2.80.0030.00518.18
8.2.70.0060.00318.13
8.2.60.0030.00518.30
8.2.50.0030.00718.13
8.2.40.0080.00018.22
8.2.30.0040.00418.32
8.2.20.0000.00717.96
8.2.10.0040.00419.75
8.2.00.0040.00418.11
8.1.280.0150.00325.92
8.1.270.0040.00422.31
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0100.00024.14
8.1.230.0000.01219.35
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0030.00617.73
8.1.190.0040.00417.55
8.1.180.0040.00418.10
8.1.170.0030.00519.08
8.1.160.0000.00722.16
8.1.150.0030.00618.96
8.1.140.0040.00417.81
8.1.130.0020.00518.02
8.1.120.0040.00417.68
8.1.110.0040.00317.81
8.1.100.0000.00817.66
8.1.90.0040.00417.82
8.1.80.0030.00517.68
8.1.70.0000.00717.64
8.1.60.0000.00917.75
8.1.50.0000.00817.76
8.1.40.0040.00417.87
8.1.30.0000.00817.80
8.1.20.0040.00417.78
8.1.10.0000.00817.94
8.1.00.0040.00417.68
8.0.300.0080.00018.77
8.0.290.0040.00417.30
8.0.280.0040.00418.63
8.0.270.0030.00317.50
8.0.260.0000.00717.05
8.0.250.0000.00717.13
8.0.240.0000.00717.16
8.0.230.0000.00717.21
8.0.220.0030.00317.09
8.0.210.0040.00417.07
8.0.200.0000.00717.31
8.0.190.0080.00017.10
8.0.180.0040.00417.17
8.0.170.0040.00417.16
8.0.160.0000.00817.10
8.0.150.0000.00717.23
8.0.140.0080.00016.98
8.0.130.0060.00313.71
8.0.120.0040.00417.00
8.0.110.0040.00417.08
8.0.100.0040.00417.24
8.0.90.0050.00217.08
8.0.80.0090.00617.09
8.0.70.0000.00717.04
8.0.60.0040.00417.00
8.0.50.0030.00517.13
8.0.30.0070.01317.41
8.0.20.0100.01017.45
8.0.10.0040.00417.05
8.0.00.0130.00617.18
7.4.330.0000.00515.37
7.4.320.0000.00716.93
7.4.300.0090.00016.96
7.4.290.0000.00717.00
7.4.280.0000.00716.93
7.4.270.0000.00717.03
7.4.260.0030.00616.88
7.4.250.0030.00516.88
7.4.240.0040.00316.71
7.4.230.0000.00716.90
7.4.220.0090.00916.84
7.4.210.0080.01016.86
7.4.200.0070.00016.96
7.4.190.0000.00816.78
7.4.160.0060.01016.54
7.4.150.0150.00317.40
7.4.140.0140.00617.86
7.4.130.0120.00616.79
7.4.120.0090.00916.89
7.4.110.0170.00716.69
7.4.100.0130.01016.73
7.4.90.0120.00616.68
7.4.80.0140.00319.39
7.4.70.0120.00916.87
7.4.60.0070.01016.66
7.4.50.0030.00616.59
7.4.40.0070.00722.77
7.4.30.0110.00516.74
7.4.00.0090.00615.25
7.3.330.0030.00513.63
7.3.320.0050.00013.70
7.3.310.0030.00316.64
7.3.300.0000.00716.58
7.3.290.0040.01116.70
7.3.280.0060.00816.58
7.3.270.0070.01117.40
7.3.260.0190.00416.69
7.3.250.0140.00616.77
7.3.240.0070.01016.99
7.3.230.0120.01216.84
7.3.210.0140.00316.89
7.3.200.0100.00719.39
7.3.190.0170.00016.92
7.3.180.0090.01016.89
7.3.170.0120.00516.83
7.3.160.0160.00016.82
7.3.120.0120.00315.46
7.2.330.0040.01517.00
7.2.320.0060.01216.79
7.2.310.0100.00616.75
7.2.300.0130.00716.86
7.2.290.0080.00816.95
7.2.00.0110.00719.35
7.1.100.0080.00018.30
7.1.70.0000.00817.46
7.1.60.0000.01519.82
7.1.50.0100.01317.20
7.1.00.0030.07722.46
7.0.200.0140.00017.05
7.0.140.0000.06722.15
7.0.60.0130.07320.06
7.0.50.0070.03718.00
7.0.40.0170.07320.26
7.0.30.0330.07320.18
7.0.20.0300.05020.19
7.0.10.0300.08320.19
7.0.00.0000.04720.22
5.6.280.0030.07321.13
5.6.210.0000.08720.73
5.6.200.0100.08318.28
5.6.190.0070.06320.63
5.6.180.0270.06720.54
5.6.170.0330.05720.63
5.6.160.0130.08020.70
5.6.150.0070.03718.24
5.6.140.0030.04018.43
5.6.130.0070.07018.22
5.6.120.0130.03320.96
5.6.110.0100.09021.12
5.6.100.0000.06721.15
5.6.90.0130.08021.15
5.6.80.0130.06320.46
5.6.70.0300.07020.54
5.5.350.0230.05320.44
5.5.340.0030.08318.18
5.5.330.0100.03720.51
5.5.320.0270.06720.51
5.5.310.0270.05320.44
5.5.300.0030.05018.03
5.5.290.0130.08018.04
5.5.280.0030.08320.95
5.5.270.0100.08020.87
5.5.260.0070.08320.89
5.5.250.0230.06720.57
5.5.240.0070.08020.26
5.4.450.0800.05319.79
5.4.440.0870.04719.55
5.4.430.0830.05019.40
5.4.420.0730.05019.63
5.4.410.0030.07719.06
5.4.400.0870.00018.95
5.4.390.0830.00018.82
5.4.380.0370.05018.87
5.4.370.0200.05018.70
5.4.360.0200.05018.86
5.4.350.0200.05018.79
5.4.340.0230.04718.93
5.4.320.0060.03812.57
5.4.310.0070.04312.56
5.4.300.0060.03912.57
5.4.290.0070.04512.57
5.4.280.0090.04112.46
5.4.270.0000.06019.05
5.4.260.0030.08318.76
5.4.250.0170.04318.88
5.4.240.0200.05019.07
5.4.230.0200.04019.05
5.4.220.0200.06019.03
5.4.210.0130.07318.88
5.4.200.0170.06718.88
5.4.190.0130.04718.79
5.4.180.0130.06719.04
5.4.170.0100.06319.04
5.4.160.0170.05019.06
5.4.150.0130.05718.83
5.4.140.0130.07016.56
5.4.130.0030.06016.49
5.4.120.0170.06316.60
5.4.110.0170.05016.76
5.4.100.0070.05316.57
5.4.90.0130.04316.70
5.4.80.0070.06016.75
5.4.70.0170.06316.48
5.4.60.0070.07016.71
5.4.50.0130.05016.44
5.4.40.0070.05016.47
5.4.30.0130.05016.61
5.4.20.0100.04716.57
5.4.10.0130.05016.54
5.4.00.0030.06015.85
5.3.290.0100.04112.83
5.3.280.0200.04314.78
5.3.270.0130.07014.73
5.3.260.0230.04314.61
5.3.250.0130.04714.73
5.3.240.0100.04714.81
5.3.230.0100.05014.72
5.3.220.0100.05314.69
5.3.210.0230.06014.66
5.3.200.0100.06314.61
5.3.190.0230.03714.44
5.3.180.0200.04014.61
5.3.170.0170.06314.62
5.3.160.0070.07314.68
5.3.150.0070.06014.59
5.3.140.0100.04714.68
5.3.130.0070.05714.61
5.3.120.0170.05014.67
5.3.110.0100.06014.72
5.3.100.0200.06013.91
5.3.90.0070.05014.06
5.3.80.0030.05314.06
5.3.70.0070.05714.03
5.3.60.0130.04314.23
5.3.50.0100.04314.00
5.3.40.0000.05713.98
5.3.30.0130.04313.78
5.3.20.0130.04313.80
5.3.10.0070.07013.66
5.3.00.0130.04313.76
5.2.170.0130.04011.35
5.2.160.0100.05711.41
5.2.150.0030.05011.09
5.2.140.0130.04011.27
5.2.130.0030.04011.15
5.2.120.0030.05711.23
5.2.110.0000.04311.04
5.2.100.0100.05311.11
5.2.90.0130.03311.30
5.2.80.0030.04311.29
5.2.70.0030.05311.11
5.2.60.0100.05311.17
5.2.50.0030.04311.22
5.2.40.0030.04711.04
5.2.30.0070.04311.18
5.2.20.0130.05010.98
5.2.10.0000.04310.88
5.2.00.0070.04310.66
5.1.60.0100.04310.14
5.1.50.0130.04010.09
5.1.40.0030.0539.98
5.1.30.0100.03010.36
5.1.20.0030.04010.23
5.1.10.0030.04010.08
5.1.00.0070.03710.16
5.0.50.0000.0308.68
5.0.40.0130.0178.47
5.0.30.0070.0378.10
5.0.20.0000.0308.22
5.0.10.0000.0308.18
5.0.00.0100.0378.20
4.4.90.0030.0237.06
4.4.80.0000.0237.06
4.4.70.0070.0177.06
4.4.60.0030.0277.06
4.4.50.0070.0237.06
4.4.40.0100.0307.06
4.4.30.0030.0207.28
4.4.20.0030.0237.28
4.4.10.0030.0237.28
4.4.00.0030.0337.28
4.3.110.0030.0237.28
4.3.100.0030.0307.28
4.3.90.0070.0277.28
4.3.80.0100.0277.28
4.3.70.0000.0277.28
4.3.60.0030.0307.28
4.3.50.0070.0207.28
4.3.40.0070.0307.27
4.3.30.0070.0207.27
4.3.20.0000.0277.27
4.3.10.0030.0307.27
4.3.00.0170.0176.88

preferences:
59.02 ms | 400 KiB | 5 Q