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(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.0150.00618.93
8.3.50.0120.00522.23
8.3.40.0090.00619.26
8.3.30.0120.00319.38
8.3.20.0070.00020.66
8.3.10.0050.00322.28
8.3.00.0080.00022.70
8.2.180.0060.00916.75
8.2.170.0110.00322.96
8.2.160.0000.01421.49
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0050.00319.73
8.2.110.0090.00022.48
8.2.100.0090.00319.64
8.2.90.0060.00319.42
8.2.80.0000.00918.05
8.2.70.0040.00417.75
8.2.60.0040.00418.15
8.2.50.0040.00418.25
8.2.40.0030.00518.41
8.2.30.0000.00818.34
8.2.20.0030.00617.96
8.2.10.0030.00519.79
8.2.00.0030.00518.15
8.1.280.0140.00425.92
8.1.270.0040.00422.49
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00424.10
8.1.230.0090.00319.35
8.1.220.0030.00517.80
8.1.210.0030.00618.77
8.1.200.0060.00317.73
8.1.190.0040.00417.43
8.1.180.0040.00418.90
8.1.170.0030.00519.09
8.1.160.0000.00722.20
8.1.150.0030.00519.07
8.1.140.0040.00417.68
8.1.130.0020.00518.04
8.1.120.0070.00017.72
8.1.110.0020.00517.75
8.1.100.0000.00717.75
8.1.90.0040.00417.83
8.1.80.0030.00517.70
8.1.70.0000.00717.75
8.1.60.0090.00017.81
8.1.50.0040.00417.78
8.1.40.0090.00017.78
8.1.30.0080.00018.01
8.1.20.0090.00017.97
8.1.10.0050.00317.73
8.1.00.0040.00417.73
8.0.300.0040.00418.77
8.0.290.0000.00717.30
8.0.280.0080.00018.52
8.0.270.0000.00717.50
8.0.260.0030.00317.09
8.0.250.0070.00017.21
8.0.240.0000.00717.31
8.0.230.0000.00717.18
8.0.220.0050.00217.03
8.0.210.0070.00017.23
8.0.200.0030.00317.16
8.0.190.0000.00917.19
8.0.180.0040.00417.06
8.0.170.0040.00417.04
8.0.160.0050.00317.08
8.0.150.0070.00017.17
8.0.140.0030.00517.04
8.0.130.0030.00513.71
8.0.120.0080.00016.98
8.0.110.0040.00417.26
8.0.100.0040.00417.15
8.0.90.0040.00416.96
8.0.80.0070.01017.24
8.0.70.0050.00216.96
8.0.60.0030.00617.00
8.0.50.0000.00817.17
8.0.30.0050.01817.04
8.0.20.0150.00817.40
8.0.10.0070.00017.20
8.0.00.0090.01117.15
7.4.330.0000.00515.29
7.4.320.0030.00316.92
7.4.300.0040.00416.97
7.4.290.0070.00016.86
7.4.280.0020.00516.91
7.4.270.0000.00716.93
7.4.260.0030.00616.70
7.4.250.0080.00016.87
7.4.240.0040.00316.92
7.4.230.0080.00017.00
7.4.220.0060.01216.77
7.4.210.0080.00616.84
7.4.200.0000.00716.83
7.4.190.0000.00717.05
7.4.160.0190.00316.75
7.4.150.0100.00717.40
7.4.140.0070.01317.86
7.4.130.0100.01016.92
7.4.120.0060.01216.74
7.4.110.0080.01216.78
7.4.100.0090.01017.09
7.4.90.0100.00716.79
7.4.80.0070.01119.39
7.4.70.0100.01316.55
7.4.60.0100.00916.80
7.4.50.0000.00816.89
7.4.40.0040.01122.77
7.4.30.0060.01116.59
7.4.00.0070.00715.21
7.3.330.0080.00013.45
7.3.320.0050.00013.50
7.3.310.0060.00316.66
7.3.300.0030.00316.51
7.3.290.0060.01216.64
7.3.280.0090.01016.64
7.3.270.0060.01117.40
7.3.260.0200.00716.96
7.3.250.0070.01116.72
7.3.240.0080.00816.93
7.3.230.0040.01316.80
7.3.210.0060.01216.89
7.3.200.0060.01619.39
7.3.190.0090.01216.86
7.3.180.0090.00916.86
7.3.170.0100.01016.95
7.3.160.0060.00916.64
7.3.120.0040.01215.08
7.3.10.0090.00616.91
7.3.00.0060.00317.03
7.2.330.0070.01016.76
7.2.320.0060.01316.95
7.2.310.0120.00916.88
7.2.300.0170.00716.96
7.2.290.0130.00316.85
7.2.130.0040.01417.17
7.2.120.0100.00617.27
7.2.110.0070.01117.17
7.2.100.0100.00717.22
7.2.90.0100.00617.23
7.2.80.0060.00917.17
7.2.70.0070.00716.90
7.2.60.0020.01317.07
7.2.50.0040.01116.86
7.2.40.0090.00617.29
7.2.30.0030.01017.03
7.2.20.0080.00816.83
7.2.10.0030.01217.10
7.2.00.0060.00418.64
7.1.250.0050.00816.00
7.1.200.0030.01016.22
7.1.100.0040.00818.26
7.1.70.0000.00817.54
7.1.60.0040.01817.68
7.1.50.0110.01117.05
7.1.00.0030.07722.38
7.0.200.0070.00216.91
7.0.140.0030.07022.07
7.0.60.0070.07019.88
7.0.50.0070.04718.16
7.0.40.0070.08720.34
7.0.30.0200.04720.22
7.0.20.0300.07720.25
7.0.10.0200.06320.35
7.0.00.0070.05320.31
5.6.280.0030.07321.21
5.6.210.0100.08020.73
5.6.200.0070.04018.28
5.6.190.0100.08020.71
5.6.180.3470.03720.71
5.6.170.0300.05720.60
5.6.160.0070.08720.58
5.6.150.0100.06018.30
5.6.140.0100.04718.30
5.6.130.0030.09018.27
5.6.120.0170.07021.04
5.6.110.0130.07021.06
5.6.100.0100.07021.16
5.6.90.0070.04021.06
5.6.80.0100.04020.45
5.6.70.0200.06320.58
5.5.350.0000.05020.39
5.5.340.0070.03718.03
5.5.330.0030.04020.45
5.5.320.0330.07020.43
5.5.310.0230.06720.43
5.5.300.0100.07318.07
5.5.290.0070.07018.23
5.5.280.0100.08320.75
5.5.270.0070.08720.96
5.5.260.0070.04020.86
5.5.250.0170.07720.71
5.5.240.0100.06720.11
5.4.450.1930.03319.61
5.4.440.1800.03719.40
5.4.430.1870.04019.24
5.4.420.1330.03719.63
5.4.410.0100.04319.35
5.4.400.0070.03718.97
5.4.390.1130.04319.34
5.4.380.1970.04319.13
5.4.370.1870.03319.32
5.4.360.1530.03318.96
5.4.350.2070.02719.20
5.4.340.1930.04019.29
5.4.320.1900.04319.32
5.4.310.2000.04319.23
5.4.300.2130.04719.28
5.4.290.1770.04019.30
5.4.280.1700.04319.13
5.4.270.1770.03719.30
5.4.260.2200.03319.14
5.4.250.1830.03719.24
5.4.240.1800.03319.02
5.4.230.2000.04019.13
5.4.220.2230.03719.16
5.4.210.2000.04019.11
5.4.200.1870.04719.15
5.4.190.1770.03718.91
5.4.180.1970.04318.91
5.4.170.1930.03319.11
5.4.160.2130.04319.30
5.4.150.1970.04019.21
5.4.140.2000.04716.53
5.4.130.2100.03716.44
5.4.120.2130.04016.64
5.4.110.2030.04316.41
5.4.100.1970.04716.48
5.4.90.1830.04016.70
5.4.80.1730.03716.36
5.4.70.2100.03316.52
5.4.60.2130.03716.62
5.4.50.1970.04016.25
5.4.40.1900.03716.34
5.4.30.1930.03316.61
5.4.20.1730.04016.55
5.4.10.1730.03716.60
5.4.00.2100.04715.92
5.3.290.2030.04014.75
5.3.280.1770.03714.64
5.3.270.1970.04014.62
5.3.260.1730.04014.76
5.3.250.1800.03714.55
5.3.240.1970.04314.54
5.3.230.2070.06314.54
5.3.220.2070.04314.64
5.3.210.2070.04314.61
5.3.200.1770.04014.65
5.3.190.2130.04314.68
5.3.180.1830.03314.60
5.3.170.2200.04314.52
5.3.160.1900.03314.71
5.3.150.2170.04714.61
5.3.140.1930.03014.63
5.3.130.2230.04714.58
5.3.120.2000.05014.59
5.3.110.1800.04014.57
5.3.100.2300.04314.00
5.3.90.0030.03714.15
5.3.80.0000.06714.14
5.3.70.0030.03313.98
5.3.60.1670.04313.95
5.3.50.1830.03313.96
5.3.40.1970.03713.89
5.3.30.2200.03713.85
5.3.20.1700.04013.66
5.3.10.2030.03713.91
5.3.00.2100.05013.71
5.2.170.1800.04011.09
5.2.160.1530.03011.08
5.2.150.1470.03011.14
5.2.140.1800.03311.08
5.2.130.1730.02711.31
5.2.120.1470.03011.05
5.2.110.1400.03311.03
5.2.100.1470.02711.14
5.2.90.1530.03711.05
5.2.80.1730.03311.06
5.2.70.1430.03311.24
5.2.60.1800.03311.10
5.2.50.1500.03011.11
5.2.40.1200.02711.01
5.2.30.1430.03011.07
5.2.20.1170.03011.01
5.2.10.1400.03010.86
5.2.00.1200.03310.77
5.1.60.1200.0209.91
5.1.50.1200.0239.93
5.1.40.1400.0309.91
5.1.30.1200.02010.31
5.1.20.1430.02710.46
5.1.10.1170.02710.26
5.1.00.1430.03010.23
5.0.50.0600.0208.67
5.0.40.0830.0238.62
5.0.30.0600.0308.39
5.0.20.0670.0178.25
5.0.10.0870.0278.21
5.0.00.0800.0478.31
4.4.90.0700.0208.00
4.4.80.0770.0208.00
4.4.70.0830.0178.00
4.4.60.0730.0238.00
4.4.50.0770.0278.00
4.4.40.0570.0308.00
4.4.30.0730.0278.00
4.4.20.0730.0238.00
4.4.10.0700.0208.00
4.4.00.0670.0308.00
4.3.110.0670.0278.00
4.3.100.0630.0178.00
4.3.90.0730.0178.00
4.3.80.0600.0238.00
4.3.70.0670.0178.00
4.3.60.0630.0208.00
4.3.50.0600.0138.00
4.3.40.0600.0238.00
4.3.30.0270.0178.00
4.3.20.0300.0178.00
4.3.10.0270.0178.00
4.3.00.0330.0178.00

preferences:
40.06 ms | 401 KiB | 5 Q