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 = 'aldanux@gmail.com'; 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.0110.00718.93
8.3.50.0140.00522.16
8.3.40.0160.00619.30
8.3.30.0040.01119.52
8.3.20.0040.00420.57
8.3.10.0080.00022.38
8.3.00.0050.00322.71
8.2.180.0070.01516.88
8.2.170.0070.01522.96
8.2.160.0090.00621.06
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0180.00026.16
8.2.120.0090.00019.72
8.2.110.0040.00722.35
8.2.100.0120.00018.28
8.2.90.0040.00419.60
8.2.80.0080.00018.05
8.2.70.0080.00018.00
8.2.60.0030.00618.29
8.2.50.0080.00018.13
8.2.40.0040.00418.47
8.2.30.0060.00318.46
8.2.20.0000.00818.14
8.2.10.0040.00419.80
8.2.00.0030.00517.99
8.1.280.0060.01325.92
8.1.270.0040.00422.35
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.66
8.1.230.0080.00421.00
8.1.220.0000.00818.04
8.1.210.0050.00318.77
8.1.200.0030.00617.50
8.1.190.0040.00417.68
8.1.180.0060.00318.91
8.1.170.0030.00518.73
8.1.160.0040.00422.16
8.1.150.0000.00818.96
8.1.140.0040.00417.78
8.1.130.0040.00418.08
8.1.120.0040.00417.70
8.1.110.0070.00017.70
8.1.100.0080.00017.60
8.1.90.0070.00017.66
8.1.80.0000.00717.67
8.1.70.0070.00017.62
8.1.60.0060.00317.82
8.1.50.0050.00317.79
8.1.40.0000.00817.79
8.1.30.0050.00318.01
8.1.20.0060.00317.82
8.1.10.0080.00017.80
8.1.00.0040.00417.76
8.0.300.0000.00718.77
8.0.290.0000.00817.30
8.0.280.0040.00418.63
8.0.270.0030.00317.43
8.0.260.0000.00817.06
8.0.250.0070.00017.08
8.0.240.0030.00517.28
8.0.230.0000.00817.16
8.0.220.0000.00717.21
8.0.210.0030.00517.12
8.0.200.0000.00717.14
8.0.190.0040.00417.16
8.0.180.0000.00817.20
8.0.170.0000.00817.07
8.0.160.0030.00517.19
8.0.150.0070.00017.20
8.0.140.0030.00517.18
8.0.130.0080.00013.59
8.0.120.0000.00817.01
8.0.110.0030.00517.13
8.0.100.0030.00517.16
8.0.90.0030.00517.02
8.0.80.0110.01117.05
8.0.70.0050.00317.24
8.0.60.0040.00416.98
8.0.50.0050.00317.00
8.0.30.0100.01317.53
8.0.20.0120.00717.45
8.0.10.0000.00817.37
8.0.00.0160.01017.05
7.4.330.0060.00015.38
7.4.320.0060.00017.03
7.4.300.0000.00716.82
7.4.290.0030.00317.02
7.4.280.0030.00316.92
7.4.270.0040.00416.83
7.4.260.0000.00816.91
7.4.250.0040.00416.77
7.4.240.0000.00716.94
7.4.230.0000.00717.06
7.4.220.0120.01216.87
7.4.210.0090.00817.02
7.4.200.0000.00816.93
7.4.190.0000.00716.78
7.4.160.0100.00716.55
7.4.150.0070.01117.40
7.4.140.0110.01117.86
7.4.130.0160.00816.72
7.4.120.0110.00716.72
7.4.110.0070.01416.79
7.4.100.0090.00916.69
7.4.90.0110.01116.57
7.4.80.0140.00619.39
7.4.70.0130.00616.69
7.4.60.0070.01016.58
7.4.50.0060.00316.86
7.4.40.0100.00722.77
7.4.30.0170.00716.81
7.4.00.0080.00915.14
7.3.330.0030.00313.46
7.3.320.0000.00513.57
7.3.310.0070.00016.50
7.3.300.0040.00416.57
7.3.290.0060.00916.62
7.3.280.0070.01016.62
7.3.270.0130.00417.40
7.3.260.0120.01216.92
7.3.250.0100.00916.66
7.3.240.0160.00716.77
7.3.230.0050.01316.79
7.3.210.0030.01516.74
7.3.200.0150.00319.39
7.3.190.0110.00616.89
7.3.180.0120.00316.70
7.3.170.0000.01716.99
7.3.160.0070.00916.68
7.3.120.0070.01015.09
7.3.110.0040.01415.30
7.3.100.0090.00315.31
7.3.90.0040.01115.39
7.3.80.0000.00914.92
7.3.70.0080.00815.07
7.3.60.0120.00015.21
7.3.50.0060.00915.21
7.3.40.0070.01014.96
7.3.30.0040.00815.07
7.3.20.0040.00716.91
7.3.10.0090.00316.90
7.3.00.0070.00416.98
7.2.330.0060.01217.00
7.2.320.0110.00716.80
7.2.310.0060.01216.96
7.2.300.0060.01316.97
7.2.290.0060.01016.70
7.2.250.0170.00314.98
7.2.240.0070.00715.40
7.2.230.0060.01315.43
7.2.220.0030.00715.15
7.2.210.0070.00715.46
7.2.200.0070.01015.11
7.2.190.0000.01215.50
7.2.180.0000.01615.25
7.2.170.0060.00915.30
7.2.00.0030.01219.62
7.1.330.0030.01316.00
7.1.320.0070.00416.14
7.1.310.0060.00316.05
7.1.300.0030.01115.75
7.1.290.0100.00715.96
7.1.280.0030.01315.68
7.1.270.0040.01116.25
7.1.260.0070.00416.07
7.1.100.0060.00618.32
7.1.70.0000.00817.51
7.1.60.0030.01019.82
7.1.50.0070.01017.05
7.1.00.0030.07722.58
7.0.200.0130.00017.00
7.0.140.0030.07322.28
7.0.60.0130.05320.02
7.0.50.0070.03718.01
7.0.40.0030.04720.07
7.0.30.0230.05720.24
7.0.20.0400.06020.21
7.0.10.0200.08720.34
7.0.00.0070.04020.34
5.6.280.0030.07320.99
5.6.210.0070.07320.75
5.6.200.0070.07718.29
5.6.190.0070.09020.64
5.6.180.0270.07320.64
5.6.170.0370.05720.56
5.6.160.0100.08720.63
5.6.150.0030.04018.23
5.6.140.0030.04018.33
5.6.130.0030.04318.28
5.6.120.0000.08021.08
5.6.110.0100.08021.15
5.6.100.0030.08321.10
5.6.90.0100.08321.13
5.6.80.0300.05320.54
5.6.70.0230.06720.59
5.5.350.0330.07020.49
5.5.340.0170.06718.03
5.5.330.0030.04320.36
5.5.320.0300.07720.54
5.5.310.0300.07720.45
5.5.300.0070.05718.12
5.5.290.0130.07017.99
5.5.280.0070.08320.94
5.5.270.0100.08020.93
5.5.260.0100.05020.96
5.5.250.0130.06720.75
5.5.240.0100.06020.44
5.4.450.0170.06019.46
5.4.440.0270.04719.42
5.4.430.0300.05019.52
5.4.420.0530.06319.41
5.4.410.0170.05018.84
5.4.400.0870.00018.75
5.4.390.0830.00018.79
5.4.380.0200.05318.89
5.4.370.0170.05018.56
5.4.360.0170.05018.92
5.4.350.0170.05318.93
5.4.340.0230.04018.56
5.4.320.0040.04412.57
5.4.310.0070.04812.57
5.4.300.0110.04212.57
5.4.290.0080.04212.56
5.4.280.0060.03912.46
5.4.270.0130.05318.91
5.4.260.0100.07018.81
5.4.250.0030.05718.81
5.4.240.0170.05018.89
5.4.230.0200.04319.07
5.4.220.0170.06718.88
5.4.210.0070.06719.05
5.4.200.0130.07318.88
5.4.190.0200.06018.90
5.4.180.0130.05718.85
5.4.170.0100.05319.06
5.4.160.0170.07019.01
5.4.150.0130.07718.73
5.4.140.0130.05316.68
5.4.130.0070.05316.50
5.4.120.0230.05716.61
5.4.110.0170.05716.46
5.4.100.0070.05016.63
5.4.90.0000.06016.55
5.4.80.0130.04716.74
5.4.70.0070.05016.74
5.4.60.0100.04316.49
5.4.50.0100.05316.48
5.4.40.0070.05316.53
5.4.30.0100.07016.49
5.4.20.0070.06016.57
5.4.10.0130.06316.44
5.4.00.0170.05016.06
5.3.290.0080.03812.83
5.3.280.0170.05014.81
5.3.270.0100.05714.78
5.3.260.0170.06314.64
5.3.250.0100.07314.65
5.3.240.0230.05014.66
5.3.230.0070.07014.54
5.3.220.0130.07014.79
5.3.210.0100.05014.69
5.3.200.0100.04714.51
5.3.190.0170.04714.69
5.3.180.0000.06014.82
5.3.170.0100.05314.51
5.3.160.0100.05014.82
5.3.150.0170.04314.78
5.3.140.0100.05314.73
5.3.130.0030.05714.59
5.3.120.0100.05014.66
5.3.110.0130.04714.64
5.3.100.0130.06014.13
5.3.90.0130.04714.27
5.3.80.0070.05014.04
5.3.70.0170.04714.13
5.3.60.0170.05714.09
5.3.50.0130.05014.17
5.3.40.0200.05714.16
5.3.30.0130.04013.96
5.3.20.0200.04713.79
5.3.10.0100.04713.77
5.3.00.0170.04013.75
5.2.170.0070.04311.16
5.2.160.0100.04011.18
5.2.150.0070.04311.34
5.2.140.0030.04711.35
5.2.130.0100.04011.23
5.2.120.0070.04011.10
5.2.110.0130.04711.04
5.2.100.0030.06011.23
5.2.90.0070.06011.11
5.2.80.0100.04311.29
5.2.70.0070.04011.10
5.2.60.0030.05311.00
5.2.50.0100.05311.22
5.2.40.0100.04711.11
5.2.30.0070.04711.19
5.2.20.0070.03711.11
5.2.10.0030.04310.72
5.2.00.0130.05010.86
5.1.60.0100.04010.11
5.1.50.0170.04010.00
5.1.40.0100.03010.07
5.1.30.0100.03310.45
5.1.20.0200.04010.48
5.1.10.0100.04310.21
5.1.00.0100.04010.30
5.0.50.0130.0308.50
5.0.40.0000.0308.44
5.0.30.0100.0508.35
5.0.20.0100.0208.25
5.0.10.0070.0338.18
5.0.00.0100.0478.21
4.4.90.0000.0277.07
4.4.80.0100.0237.07
4.4.70.0070.0207.07
4.4.60.0100.0237.07
4.4.50.0070.0237.07
4.4.40.0000.0377.07
4.4.30.0000.0307.07
4.4.20.0170.0207.07
4.4.10.0030.0237.07
4.4.00.0030.0337.07
4.3.110.0030.0337.07
4.3.100.0100.0237.07
4.3.90.0000.0277.07
4.3.80.0030.0337.07
4.3.70.0000.0237.07
4.3.60.0070.0207.07
4.3.50.0030.0207.07
4.3.40.0030.0337.07
4.3.30.0000.0237.07
4.3.20.0030.0207.07
4.3.10.0030.0277.07
4.3.00.0000.0306.88

preferences:
37.49 ms | 401 KiB | 5 Q