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 = 'ss@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.0140.00719.02
8.3.50.0100.00622.11
8.3.40.0080.00819.46
8.3.30.0110.00419.64
8.3.20.0030.00620.71
8.3.10.0040.00422.32
8.3.00.0060.00322.75
8.2.180.0120.00917.00
8.2.170.0120.00622.96
8.2.160.0100.00321.39
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00421.32
8.2.110.0000.01022.49
8.2.100.0080.00719.83
8.2.90.0030.00519.48
8.2.80.0040.00418.18
8.2.70.0070.00318.09
8.2.60.0080.00018.30
8.2.50.0000.00818.07
8.2.40.0040.00418.53
8.2.30.0040.00418.44
8.2.20.0000.00918.04
8.2.10.0080.00019.93
8.2.00.0040.00418.00
8.1.280.0150.00025.92
8.1.270.0030.00622.49
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0040.00718.99
8.1.230.0120.00019.41
8.1.220.0050.00318.03
8.1.210.0000.00818.77
8.1.200.0030.00617.60
8.1.190.0040.00417.63
8.1.180.0030.00518.10
8.1.170.0080.00019.05
8.1.160.0060.00322.22
8.1.150.0040.00419.10
8.1.140.0040.00417.80
8.1.130.0050.00317.98
8.1.120.0020.00517.65
8.1.110.0040.00417.68
8.1.100.0020.00517.84
8.1.90.0000.00717.82
8.1.80.0080.00017.70
8.1.70.0000.00717.71
8.1.60.0060.00317.88
8.1.50.0080.00017.80
8.1.40.0000.00817.90
8.1.30.0080.00017.94
8.1.20.0040.00417.89
8.1.10.0040.00417.82
8.1.00.0050.00317.72
8.0.300.0030.00618.77
8.0.290.0060.00317.43
8.0.280.0040.00418.58
8.0.270.0000.00717.39
8.0.260.0030.00317.16
8.0.250.0030.00317.28
8.0.240.0000.00717.12
8.0.230.0030.00317.34
8.0.220.0070.00017.16
8.0.210.0040.00417.17
8.0.200.0030.00317.20
8.0.190.0040.00417.13
8.0.180.0050.00217.11
8.0.170.0000.00717.18
8.0.160.0040.00417.13
8.0.150.0000.01016.98
8.0.140.0080.00017.23
8.0.130.0100.00013.69
8.0.120.0040.00417.06
8.0.110.0040.00417.08
8.0.100.0000.00817.22
8.0.90.0000.00717.13
8.0.80.0000.01717.21
8.0.70.0050.00317.26
8.0.60.0050.00317.25
8.0.50.0040.00417.11
8.0.30.0030.01717.40
8.0.20.0120.00717.40
8.0.10.0000.00817.23
8.0.00.0150.00617.08
7.4.330.0030.00315.34
7.4.320.0030.00316.86
7.4.300.0080.00316.81
7.4.290.0030.00316.84
7.4.280.0000.00716.74
7.4.270.0000.00716.86
7.4.260.0000.00716.82
7.4.250.0000.00816.90
7.4.240.0020.00516.90
7.4.230.0030.00317.02
7.4.220.0140.00617.00
7.4.210.0100.00716.86
7.4.200.0080.00016.93
7.4.190.0000.00717.10
7.4.160.0100.00716.85
7.4.150.0120.00617.40
7.4.140.0130.00617.86
7.4.130.0140.00516.65
7.4.120.0030.01416.96
7.4.110.0090.01516.70
7.4.100.0100.00916.83
7.4.90.0090.00916.92
7.4.80.0130.01019.39
7.4.70.0100.00716.90
7.4.60.0100.01416.96
7.4.50.0050.00016.89
7.4.40.0040.01522.77
7.4.30.0170.00616.79
7.4.00.0030.00715.40
7.3.330.0070.00013.66
7.3.320.0050.00013.58
7.3.310.0030.00316.57
7.3.300.0000.00716.49
7.3.290.0000.01516.63
7.3.280.0110.00416.60
7.3.270.0150.00917.40
7.3.260.0150.00616.65
7.3.250.0050.01516.92
7.3.240.0060.01416.65
7.3.230.0130.00316.53
7.3.210.0130.00316.67
7.3.200.0040.01419.39
7.3.190.0110.00716.74
7.3.180.0080.00816.93
7.3.170.0120.00916.91
7.3.160.0120.00316.82
7.3.120.0000.01315.28
7.2.330.0100.00717.09
7.2.320.0090.01116.93
7.2.310.0180.00016.98
7.2.300.0030.01516.93
7.2.290.0050.01117.02
7.2.00.0030.00919.88
7.1.100.0090.00318.66
7.1.70.0000.00817.49
7.1.60.0120.00619.82
7.1.50.0120.01217.32
7.1.00.0030.07722.56
7.0.200.0060.00617.02
7.0.140.0070.07022.14
7.0.60.0070.05020.04
7.0.50.0100.06318.00
7.0.40.0000.06020.29
7.0.30.0370.07020.17
7.0.20.0300.06720.26
7.0.10.0270.07720.19
7.0.00.0170.04320.26
5.6.280.0000.07720.97
5.6.210.0200.07020.74
5.6.200.0030.05318.36
5.6.190.0030.05320.58
5.6.180.3400.04720.58
5.6.170.0300.08020.57
5.6.160.0030.08320.57
5.6.150.0100.08018.28
5.6.140.0130.07318.27
5.6.130.0070.06718.36
5.6.120.0030.04321.11
5.6.110.0030.04021.10
5.6.100.0170.06321.03
5.6.90.0030.07021.05
5.6.80.0100.05020.45
5.6.70.0230.05020.39
5.5.350.0100.07720.56
5.5.340.0100.07018.04
5.5.330.0030.04720.55
5.5.320.0270.07320.41
5.5.310.0300.06020.39
5.5.300.0030.07718.03
5.5.290.0030.08318.04
5.5.280.0070.08721.03
5.5.270.0100.05020.95
5.5.260.0070.08320.83
5.5.250.0030.05320.72
5.5.240.0030.07720.25
5.4.450.0700.06719.28
5.4.440.0570.06319.28
5.4.430.0130.07319.45
5.4.420.0100.05319.59
5.4.410.0200.04319.61
5.4.400.0930.00018.86
5.4.390.0900.00018.84
5.4.380.0270.05018.82
5.4.370.0100.05718.59
5.4.360.0230.04718.81
5.4.350.0200.05018.85
5.4.340.0130.06718.86
5.4.320.0120.03812.57
5.4.310.0060.03712.56
5.4.300.0080.04312.57
5.4.290.0040.03912.57
5.4.280.0120.03212.46
5.4.270.0030.06018.89
5.4.260.0130.04719.21
5.4.250.0230.06318.75
5.4.240.0100.07318.88
5.4.230.0100.05319.19
5.4.220.0270.05018.70
5.4.210.0130.07018.88
5.4.200.0130.04718.99
5.4.190.0070.05718.87
5.4.180.0030.05719.08
5.4.170.0100.07018.91
5.4.160.0070.07318.97
5.4.150.0000.06019.04
5.4.140.0170.06016.54
5.4.130.0130.05016.52
5.4.120.0230.05716.57
5.4.110.0070.05016.69
5.4.100.0100.06716.48
5.4.90.0030.05016.67
5.4.80.0170.04016.67
5.4.70.0070.05316.55
5.4.60.0100.06716.55
5.4.50.0100.05316.62
5.4.40.0100.04716.50
5.4.30.0100.05016.52
5.4.20.0170.06316.60
5.4.10.0130.06016.39
5.4.00.0100.07016.06
5.3.290.0030.05112.83
5.3.280.0130.05714.86
5.3.270.0170.07014.87
5.3.260.0230.06014.73
5.3.250.0030.05314.70
5.3.240.0100.05314.63
5.3.230.0070.05714.72
5.3.220.0170.04314.58
5.3.210.0130.05014.69
5.3.200.0170.06014.77
5.3.190.0100.05714.59
5.3.180.0170.04014.77
5.3.170.0100.04714.60
5.3.160.0070.06014.51
5.3.150.0130.06714.57
5.3.140.0130.05314.81
5.3.130.0130.06714.51
5.3.120.0070.05714.68
5.3.110.0070.07714.67
5.3.100.0230.05014.24
5.3.90.0100.05014.14
5.3.80.0070.05014.15
5.3.70.0130.04313.89
5.3.60.0030.05313.87
5.3.50.0100.05014.08
5.3.40.0070.06014.08
5.3.30.0130.05013.97
5.3.20.0170.05013.75
5.3.10.0030.05313.66
5.3.00.0070.06013.74
5.2.170.0030.06011.26
5.2.160.0170.04711.14
5.2.150.0170.04311.35
5.2.140.0100.05311.17
5.2.130.0100.04710.97
5.2.120.0100.03711.10
5.2.110.0130.03011.11
5.2.100.0030.04711.21
5.2.90.0030.05311.04
5.2.80.0130.03311.12
5.2.70.0070.04011.30
5.2.60.0130.03311.06
5.2.50.0070.04011.13
5.2.40.0000.04711.21
5.2.30.0070.04011.10
5.2.20.0130.05010.90
5.2.10.0100.03710.96
5.2.00.0070.04310.66
5.1.60.0030.04710.22
5.1.50.0130.02710.13
5.1.40.0100.03310.26
5.1.30.0030.03710.46
5.1.20.0100.04010.56
5.1.10.0100.04310.15
5.1.00.0070.03310.18
5.0.50.0070.0308.43
5.0.40.0100.0338.52
5.0.30.0070.0538.34
5.0.20.0000.0308.07
5.0.10.0000.0338.23
5.0.00.0100.0378.19
4.4.90.0070.0277.06
4.4.80.0000.0277.06
4.4.70.0030.0307.06
4.4.60.0030.0277.06
4.4.50.0000.0307.06
4.4.40.0100.0377.06
4.4.30.0000.0237.06
4.4.20.0000.0237.06
4.4.10.0070.0177.06
4.4.00.0000.0377.06
4.3.110.0030.0277.06
4.3.100.0100.0177.06
4.3.90.0100.0237.06
4.3.80.0100.0237.06
4.3.70.0170.0077.05
4.3.60.0070.0237.06
4.3.50.0100.0237.06
4.3.40.0000.0407.06
4.3.30.0030.0207.06
4.3.20.0030.0207.06
4.3.10.0030.0237.06
4.3.00.0130.0207.77

preferences:
46.75 ms | 401 KiB | 5 Q