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.d'; var_dump($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.25
8.3.50.0100.00721.93
8.3.40.0070.00718.66
8.3.30.0110.00418.96
8.3.20.0000.00820.30
8.3.10.0040.00422.09
8.3.00.0040.00422.52
8.2.180.0090.00616.63
8.2.170.0140.00022.96
8.2.160.0070.00721.10
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00220.89
8.2.110.0140.00622.06
8.2.100.0080.00419.32
8.2.90.0050.00318.88
8.2.80.0030.00617.97
8.2.70.0000.00917.23
8.2.60.0060.00317.93
8.2.50.0030.00518.07
8.2.40.0040.00418.16
8.2.30.0040.00418.07
8.2.20.0040.00417.63
8.2.10.0040.00419.38
8.2.00.0050.00217.71
8.1.280.0150.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0100.00723.84
8.1.230.0110.00019.10
8.1.220.0000.00717.74
8.1.210.0030.00518.77
8.1.200.0000.01017.23
8.1.190.0040.00417.30
8.1.180.0050.00318.55
8.1.170.0060.00318.24
8.1.160.0000.00721.98
8.1.150.0000.00818.66
8.1.140.0040.00417.31
8.1.130.0030.00317.74
8.1.120.0050.00217.38
8.1.110.0000.00717.32
8.1.100.0040.00417.45
8.1.90.0050.00217.51
8.1.80.0020.00517.44
8.1.70.0030.00317.40
8.1.60.0060.00317.60
8.1.50.0030.00517.56
8.1.40.0000.00917.46
8.1.30.0040.00417.62
8.1.20.0040.00417.57
8.1.10.0030.00617.43
8.1.00.0030.00517.39
8.0.300.0000.00718.77
8.0.290.0040.00417.04
8.0.280.0040.00418.39
8.0.270.0030.00317.29
8.0.260.0030.00316.80
8.0.250.0070.00016.82
8.0.240.0040.00416.82
8.0.230.0070.00016.77
8.0.220.0000.00616.92
8.0.210.0040.00416.89
8.0.200.0000.00616.95
8.0.190.0030.00516.89
8.0.180.0000.00716.78
8.0.170.0040.00416.90
8.0.160.0040.00416.97
8.0.150.0040.00316.83
8.0.140.0030.00516.84
8.0.130.0000.00813.31
8.0.120.0080.00016.87
8.0.110.0000.00816.88
8.0.100.0030.00616.74
8.0.90.0070.00016.71
8.0.80.0040.01116.87
8.0.70.0040.00416.77
8.0.60.0050.00216.66
8.0.50.0050.00316.85
8.0.30.0050.01417.08
8.0.20.0080.01017.40
8.0.10.0000.00717.04
8.0.00.0110.01216.78
7.4.330.0050.00015.00
7.4.320.0000.00716.57
7.4.300.0090.00016.34
7.4.290.0030.00316.59
7.4.280.0030.00316.59
7.4.270.0040.00416.50
7.4.260.0100.00016.52
7.4.250.0050.00316.54
7.4.240.0000.00716.45
7.4.230.0030.00316.46
7.4.220.0070.01016.44
7.4.210.0090.00716.48
7.4.200.0000.00716.59
7.4.190.0000.00716.58
7.4.160.0140.00716.57
7.4.150.0090.00917.40
7.4.140.0120.00617.86
7.4.130.0080.01016.35
7.4.120.0080.00816.48
7.4.110.0080.01116.55
7.4.100.0070.01116.49
7.4.90.0060.01116.40
7.4.80.0070.01019.39
7.4.70.0140.00316.50
7.4.60.0060.01016.48
7.4.50.0090.00016.33
7.4.40.0090.00622.77
7.4.30.0080.00816.66
7.4.00.0070.01014.98
7.3.330.0030.00313.13
7.3.320.0000.00513.18
7.3.310.0030.00316.20
7.3.300.0030.00316.21
7.3.290.0110.00316.16
7.3.280.0060.00816.17
7.3.270.0100.01017.40
7.3.260.0180.00616.13
7.3.250.0100.00716.33
7.3.240.0030.01316.47
7.3.230.0160.00316.39
7.3.210.0130.00316.23
7.3.200.0060.01119.39
7.3.190.0030.01816.38
7.3.180.0040.01116.07
7.3.170.0060.01216.31
7.3.160.0110.00416.19
7.3.120.0050.01214.83
7.3.110.0030.01414.66
7.3.100.0070.00714.67
7.3.90.0040.01114.64
7.3.80.0050.00814.95
7.3.70.0060.00814.82
7.3.60.0050.00914.56
7.3.50.0100.00514.75
7.3.40.0040.00814.85
7.3.30.0080.00614.85
7.3.20.0050.00616.38
7.3.10.0050.00816.39
7.3.00.0030.00916.42
7.2.330.0130.00416.58
7.2.320.0120.01216.47
7.2.310.0130.00316.52
7.2.300.0180.00616.50
7.2.290.0110.00416.38
7.2.240.0070.01014.88
7.2.230.0070.00814.76
7.2.220.0080.00815.05
7.2.210.0040.01014.93
7.2.200.0050.00714.78
7.2.190.0060.00614.78
7.2.180.0120.00514.68
7.2.170.0010.01214.59
7.2.160.0030.01014.73
7.2.150.0060.01116.56
7.2.140.0030.01016.64
7.2.130.0050.00716.67
7.2.120.0060.00916.70
7.2.110.0050.00816.77
7.2.100.0050.00816.71
7.2.90.0060.00816.63
7.2.80.0030.01416.73
7.2.70.0070.00716.89
7.2.60.0080.00816.83
7.2.50.0070.01016.61
7.2.40.0060.01216.66
7.2.30.0040.00916.72
7.2.20.0080.00716.82
7.2.10.0050.01016.82
7.2.00.0080.00516.72
7.1.330.0030.01415.48
7.1.320.0020.00915.85
7.1.310.0080.00715.68
7.1.300.0070.00815.58
7.1.290.0050.01015.73
7.1.280.0040.01115.69
7.1.270.0100.00515.57
7.1.260.0060.00915.69
7.1.250.0060.00815.79
7.1.70.0000.01217.06
7.1.60.0030.01719.82
7.1.50.0130.01316.80
7.1.00.0000.08022.57
7.0.200.0090.00416.68
7.0.140.0100.06322.00
7.0.60.0030.08319.92
7.0.50.0070.04017.88
7.0.40.0070.06720.11
7.0.30.0230.04320.06
7.0.20.0200.04320.10
7.0.10.0270.07720.20
7.0.00.0070.08320.06
5.6.280.0130.08020.92
5.6.210.0130.07320.77
5.6.200.0000.04718.29
5.6.190.0130.08020.77
5.6.180.3270.04320.50
5.6.170.0370.07320.55
5.6.160.0070.08320.45
5.6.150.0070.06018.19
5.6.140.0070.07318.23
5.6.130.0070.07318.27
5.6.120.0130.04721.13
5.6.110.0030.04720.98
5.6.100.0100.06721.10
5.6.90.0000.08321.02
5.6.80.0070.07320.55
5.6.70.0330.07020.49
5.5.350.0000.03720.38
5.5.340.0000.08318.04
5.5.330.0130.07720.25
5.5.320.0300.07320.30
5.5.310.0300.07320.19
5.5.300.0000.04318.04
5.5.290.0030.07717.95
5.5.280.0130.06720.96
5.5.270.0070.04720.78
5.5.260.0070.07720.89
5.5.250.0170.06720.71
5.5.240.0100.08020.18
5.4.450.0500.06319.59
5.4.440.0670.05319.70
5.4.430.0130.05319.63
5.4.420.0000.06319.52
5.4.410.0070.05719.57
5.4.400.0830.00018.89
5.4.390.1130.00018.63
5.4.380.0230.05718.54
5.4.370.0300.03718.61
5.4.360.0270.05018.56
5.4.350.0130.05718.70
5.4.340.0330.04018.57
5.4.320.0080.03712.51
5.4.310.0080.04412.51
5.4.300.0080.03512.52
5.4.290.0100.04012.51
5.4.280.0050.03812.41
5.4.270.0070.05319.00
5.4.260.0070.07319.10
5.4.250.0070.05318.77
5.4.240.0030.05719.00
5.4.230.0130.05018.80
5.4.220.0070.05718.90
5.4.210.0030.05719.00
5.4.200.0200.04019.00
5.4.190.0030.06018.76
5.4.180.0130.06719.02
5.4.170.0070.07318.93
5.4.160.0130.04718.95
5.4.150.0030.05718.98
5.4.140.0030.05716.49
5.4.130.0130.06016.45
5.4.120.0030.05316.58
5.4.110.0070.05016.54
5.4.100.0100.06016.41
5.4.90.0100.07016.55
5.4.80.0070.05016.39
5.4.70.0000.05716.48
5.4.60.0000.05316.39
5.4.50.0100.04716.47
5.4.40.0130.04316.44
5.4.30.0030.07316.49
5.4.20.0130.04316.35
5.4.10.0130.06716.48
5.4.00.0270.03715.99
5.3.290.0090.04412.80
5.3.280.0170.05714.69
5.3.270.0070.05014.70
5.3.260.0070.05714.70
5.3.250.0130.04314.75
5.3.240.0100.05014.60
5.3.230.0030.05314.70
5.3.220.0100.05014.58
5.3.210.0030.05714.80
5.3.200.0200.03714.58
5.3.190.0200.04014.57
5.3.180.0170.06014.60
5.3.170.0170.05714.67
5.3.160.0170.04014.66
5.3.150.0130.05014.66
5.3.140.0070.05014.55
5.3.130.0070.08014.55
5.3.120.0170.04714.39
5.3.110.0130.06714.47
5.3.100.0070.05014.06
5.3.90.0000.05714.25
5.3.80.0170.06014.12
5.3.70.0100.07013.94
5.3.60.0200.05714.08
5.3.50.0070.06013.96
5.3.40.0170.06314.04
5.3.30.0170.06013.89
5.3.20.0030.07013.79
5.3.10.0030.07313.68
5.3.00.0070.06013.72
5.2.170.0170.05311.12
5.2.160.0000.05711.23
5.2.150.0070.04011.26
5.2.140.0030.04710.99
5.2.130.0070.03711.13
5.2.120.0070.05311.34
5.2.110.0170.03011.11
5.2.100.0070.05711.03
5.2.90.0070.04711.07
5.2.80.0000.04711.06
5.2.70.0030.04311.27
5.2.60.0070.05311.06
5.2.50.0070.05011.21
5.2.40.0200.04011.09
5.2.30.0170.03311.20
5.2.20.0170.03711.04
5.2.10.0030.05311.05
5.2.00.0100.03310.82
5.1.60.0000.0479.97
5.1.50.0030.0439.99
5.1.40.0070.04710.09
5.1.30.0030.03710.43
5.1.20.0030.05010.44
5.1.10.0070.03310.05
5.1.00.0100.03010.05
5.0.50.0070.0278.65
5.0.40.0030.0278.59
5.0.30.0000.0478.28
5.0.20.0070.0378.27
5.0.10.0100.0378.03
5.0.00.0030.0508.22
4.4.90.0070.0277.28
4.4.80.0000.0237.28
4.4.70.0030.0237.28
4.4.60.0000.0237.28
4.4.50.0030.0207.28
4.4.40.0130.0277.28
4.4.30.0100.0207.28
4.4.20.0030.0207.28
4.4.10.0070.0207.28
4.4.00.0030.0337.28
4.3.110.0070.0207.28
4.3.100.0030.0307.28
4.3.90.0000.0237.28
4.3.80.0070.0307.28
4.3.70.0000.0237.28
4.3.60.0000.0207.28
4.3.50.0000.0337.28
4.3.40.0070.0277.28
4.3.30.0030.0207.28
4.3.20.0070.0277.28
4.3.10.0000.0277.28
4.3.00.0230.0177.19

preferences:
45.39 ms | 401 KiB | 5 Q