3v4l.org

run code in 300+ PHP versions simultaneously
<?php $email = 'geradolson5656@srt.com'; if (validEmail($email)) { echo 'YES'; } else { echo 'NO'; } 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; }

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.5.10.0110.00620.21
8.5.00.0120.01120.39
8.4.160.0160.00822.14
8.4.150.0010.00114.05
8.4.140.0160.00518.06
8.4.130.0110.01018.47
8.4.120.0130.00824.00
8.4.110.0090.01020.65
8.4.100.0130.01018.00
8.4.90.0120.00719.11
8.4.80.0010.00818.16
8.4.70.0060.00218.13
8.4.60.0120.01018.97
8.4.50.0120.00818.32
8.4.40.0100.01019.96
8.4.30.0170.00318.32
8.4.20.0040.01518.30
8.4.10.0100.01018.44
8.3.280.0070.01318.74
8.3.270.0130.00717.11
8.3.260.0120.00716.95
8.3.250.0160.00219.14
8.3.240.0090.00616.87
8.3.230.0110.00617.23
8.3.220.0140.00617.28
8.3.210.0050.00517.29
8.3.200.0050.00317.04
8.3.190.0030.00517.30
8.3.180.0120.00718.94
8.3.170.0110.00319.20
8.3.160.0180.00418.58
8.3.150.0090.00919.25
8.3.140.0090.00018.86
8.3.130.0040.00418.77
8.3.120.0060.00319.32
8.3.110.0060.00316.87
8.3.100.0090.00316.85
8.3.90.0000.00826.77
8.3.80.0030.00717.25
8.3.70.0120.00617.25
8.3.60.0070.00718.80
8.3.50.0120.01021.32
8.3.40.0090.00619.20
8.3.30.0070.00719.21
8.3.20.0080.00020.66
8.3.10.0000.00821.98
8.3.00.0060.00319.94
8.2.290.0140.00520.39
8.2.280.0130.00618.79
8.2.270.0140.00417.42
8.2.260.0000.00819.05
8.2.250.0060.00317.06
8.2.240.0060.00318.72
8.2.230.0100.00720.94
8.2.220.0080.00824.06
8.2.210.0100.00026.77
8.2.200.0090.00318.54
8.2.190.0130.01016.75
8.2.180.0150.00618.54
8.2.170.0070.00719.33
8.2.160.0100.01022.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0140.00017.87
8.2.110.0070.00321.25
8.2.100.0000.01218.22
8.2.90.0040.00418.34
8.2.80.0040.00418.13
8.2.70.0000.00918.13
8.2.60.0040.00418.41
8.2.50.0040.00418.25
8.2.40.0030.00521.25
8.2.30.0100.00018.43
8.2.20.0040.00417.99
8.2.10.0040.00418.40
8.2.00.0020.00518.30
8.1.330.0100.00920.52
8.1.320.0060.01316.26
8.1.310.0040.01116.68
8.1.300.0090.00018.12
8.1.290.0060.00330.84
8.1.280.0150.00325.92
8.1.270.0060.01320.38
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0060.00322.86
8.1.230.0040.00821.29
8.1.220.0100.00017.93
8.1.210.0030.00619.15
8.1.200.0000.00917.72
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0030.00519.09
8.1.160.0050.00222.27
8.1.150.0000.00719.20
8.1.140.0030.00517.83
8.1.130.0000.00720.35
8.1.120.0030.00517.64
8.1.110.0000.00717.68
8.1.100.0000.00717.65
8.1.90.0000.00817.63
8.1.80.0000.01017.71
8.1.70.0000.00717.66
8.1.60.0000.00817.95
8.1.50.0050.00517.73
8.1.40.0080.00017.86
8.1.30.0040.00717.92
8.1.20.0080.00017.97
8.1.10.0040.00417.71
8.1.00.0080.00017.89
8.0.300.0000.00720.29
8.0.290.0040.00417.00
8.0.280.0000.00818.64
8.0.270.0080.00017.39
8.0.260.0080.00018.64
8.0.250.0030.00517.23
8.0.240.0060.00317.08
8.0.230.0000.00817.27
8.0.220.0040.00417.16
8.0.210.0000.00817.05
8.0.200.0000.00717.13
8.0.190.0080.00017.13
8.0.180.0070.00017.16
8.0.170.0040.00417.07
8.0.160.0000.00717.32
8.0.150.0000.00717.12
8.0.140.0040.00417.10
8.0.130.0000.00613.59
8.0.120.0030.00517.02
8.0.110.0040.00417.03
8.0.100.0000.00817.04
8.0.90.0000.00717.17
8.0.80.0030.01317.15
8.0.70.0040.00417.17
8.0.60.0030.00617.01
8.0.50.0060.00317.25
8.0.30.0110.00617.57
8.0.20.0120.01217.56
8.0.10.0080.00017.30
8.0.00.0130.00916.91
7.4.330.0000.00515.27
7.4.320.0000.00616.75
7.4.300.0030.00316.84
7.4.290.0000.00716.94
7.4.280.0050.00216.83
7.4.270.0080.00016.84
7.4.260.0000.00716.91
7.4.250.0000.00816.75
7.4.240.0000.00716.79
7.4.230.0000.00716.96
7.4.220.0100.01016.95
7.4.210.0100.00616.96
7.4.200.0040.00416.94
7.4.160.0100.01316.81
7.4.150.0140.01017.40
7.4.140.0180.01717.86
7.4.130.0150.00816.69
7.4.120.0060.01216.77
7.4.110.0160.00316.88
7.4.100.0180.00616.79
7.4.90.0070.01016.68
7.4.80.0060.01219.39
7.4.70.0090.00916.65
7.4.60.0090.01516.62
7.4.50.0050.00016.62
7.4.40.0110.01116.55
7.4.30.0140.00416.93
7.4.00.0100.00715.27
7.3.330.0020.00213.45
7.3.320.0020.00213.54
7.3.310.0070.00016.61
7.3.300.0000.00816.54
7.3.290.0050.00316.54
7.3.280.0140.00516.68
7.3.270.0100.00717.40
7.3.260.0130.00916.68
7.3.250.0100.00716.57
7.3.240.0090.01516.68
7.3.230.0140.01116.57
7.3.210.0130.00916.87
7.3.200.0170.00019.39
7.3.190.0110.00716.64
7.3.180.0070.01016.50
7.3.170.0100.01016.86
7.3.160.0140.00416.84
7.3.120.0040.01815.05
7.3.110.0040.01515.14
7.3.100.0040.00715.26
7.3.90.0080.00415.07
7.3.80.0070.00714.74
7.3.70.0000.01315.16
7.3.60.0070.00715.04
7.3.50.0030.01015.14
7.3.40.0070.00715.00
7.3.30.0090.00915.03
7.3.20.0110.00317.15
7.3.10.0060.00316.70
7.3.00.0060.00616.81
7.2.330.0100.01017.09
7.2.320.0060.01317.06
7.2.310.0100.00716.95
7.2.300.0100.00716.89
7.2.290.0130.00917.00
7.2.250.0030.01715.57
7.2.240.0040.01515.25
7.2.230.0100.00315.21
7.2.220.0000.01615.37
7.2.210.0070.01115.32
7.2.200.0080.00415.30
7.2.190.0000.01115.09
7.2.180.0090.00015.18
7.2.170.0070.01114.98
7.2.00.0000.00919.89
7.1.330.0030.01016.04
7.1.320.0060.00916.02
7.1.310.0030.00616.33
7.1.300.0000.01116.05
7.1.290.0070.00716.22
7.1.280.0040.00416.24
7.1.270.0030.01015.74
7.1.260.0000.01316.24
7.1.100.0080.00418.13
7.1.70.0000.00717.46
7.1.60.0060.01920.03
7.1.50.0110.01117.34
7.1.00.0070.07322.55
7.0.200.0040.00716.73
7.0.60.0070.07321.88
7.0.50.0070.08017.83
7.0.40.0130.05320.25
7.0.30.0370.05320.34
7.0.20.0300.06720.21
7.0.10.0100.07720.34
7.0.00.0100.07320.33
5.6.280.0030.06321.08
5.6.210.0000.04320.69
5.6.200.0100.07018.25
5.6.190.0100.08320.68
5.6.180.4400.04320.41
5.6.170.0130.04720.59
5.6.160.0200.06720.61
5.6.150.0100.03718.27
5.6.140.0130.07318.23
5.6.130.0100.04018.22
5.6.120.0100.06021.16
5.6.110.0070.09321.08
5.6.100.0100.07021.04
5.6.90.0130.07721.04
5.6.80.0030.06320.58
5.5.350.0370.05020.49
5.5.340.0000.07717.99
5.5.330.0030.04320.52
5.5.320.0000.04320.36
5.5.310.0370.05020.45
5.5.300.0030.04718.15
5.5.290.0030.07318.04
5.5.280.0030.06020.94
5.5.270.0000.07720.94
5.5.260.0000.04721.05
5.5.250.0100.05720.79
5.5.240.0030.07020.26
5.4.450.0170.06019.72
5.4.440.0200.06319.70
5.4.430.0570.06019.42
5.4.420.0300.06019.45
5.4.410.0130.05019.52
5.4.400.0200.05319.20
5.4.390.0570.05718.95
5.4.380.0670.04019.38
5.4.370.0630.05719.09
5.4.360.0630.05719.46
5.4.350.0730.04019.23
5.4.340.0600.07319.14
5.4.320.0470.06318.95
5.4.310.0530.05319.17
5.4.300.0570.05319.09
5.4.290.0730.06019.22
5.4.280.0800.05319.35
5.4.270.0770.06319.20
5.4.260.0800.05019.36
5.4.250.0530.04719.12
5.4.240.0500.05319.09
5.4.230.0830.07319.20
5.4.220.0770.07318.92
5.4.210.0870.04719.10
5.4.200.0530.07016.79
5.4.190.0700.05019.04
5.4.180.0500.05319.29
5.4.170.0670.05019.16
5.4.160.0570.05719.14
5.4.150.0700.06019.11
5.4.140.0900.06016.57
5.4.130.0700.06716.49
5.4.120.0670.05316.42
5.4.110.0770.04016.66
5.4.100.0570.05016.56
5.4.90.0570.04316.69
5.4.80.0570.05016.62
5.4.70.0670.05016.39
5.4.60.0630.05016.38
5.4.50.0570.04316.42
5.4.40.0530.04716.42
5.4.30.0570.04316.59
5.4.20.0400.05716.37
5.4.10.0970.05316.47
5.4.00.0530.05015.96

preferences:
41.42 ms | 403 KiB | 5 Q