3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'fd.com..ec'; $pattern = '/^[A-Z0-9.-]+\.[A-Z]{2,}\b/i'; var_dump(preg_match($pattern, $str)); /*function validaEmailUsername($str){ $allowed = array("-", ".", "_"); // you can add here more value, you want to allow. $regExp = implode($allowed); $str = trim($str); //valido inicio y fin del username no tenga .-_ if( (preg_match('/^['.$regExp.']|['.$regExp.']$/i', $str) == 0) && (strlen($str) > 5) ) { $count_special_char = preg_match_all("/[".$regExp."]/i", $str, $matches); if( ctype_alnum(str_replace($allowed, '', $str )) && ($count_special_char == 0 || $count_special_char == 1) ){ $badWords = array("usuario","user","test","demo","notiene", "prueba", ".com", ".net"); $matches = array(); $matchFound = preg_match_all("/\b(" . implode($badWords,"|") . ")\b/i", $str, $matches); if ($matchFound){ return false; } return true; } } return false; }*/

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.40.0120.00618.58
8.3.30.0120.00318.67
8.3.20.0070.00721.74
8.3.10.0090.00021.89
8.3.00.0050.00317.68
8.2.170.0110.00722.96
8.2.160.0070.00721.22
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00022.20
8.2.120.0040.00426.35
8.2.110.0090.00021.04
8.2.100.0090.00317.75
8.2.90.0000.00819.11
8.2.80.0000.00817.97
8.2.70.0000.00817.75
8.2.60.0000.00917.80
8.2.50.0050.00318.10
8.2.40.0090.00022.13
8.2.30.0030.00519.26
8.2.20.0000.00718.04
8.2.10.0030.00518.07
8.2.00.0000.00818.05
8.1.270.0000.00823.83
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00621.31
8.1.230.0070.00319.10
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0040.00417.23
8.1.190.0030.00517.35
8.1.180.0060.00318.10
8.1.170.0040.00418.70
8.1.160.0000.00818.91
8.1.150.0050.00320.09
8.1.140.0000.00719.41
8.1.130.0040.00418.71
8.1.120.0050.00317.55
8.1.110.0000.00717.55
8.1.100.0030.00317.43
8.1.90.0040.00417.45
8.1.80.0040.00417.54
8.1.70.0000.00717.57
8.1.60.0040.00417.68
8.1.50.0040.00417.64
8.1.40.0000.00817.64
8.1.30.0040.00417.65
8.1.20.0060.00317.71
8.1.10.0000.00817.66
8.1.00.0000.00817.39
8.0.300.0050.00220.02
8.0.290.0000.00816.75
8.0.280.0030.00318.40
8.0.270.0030.00317.22
8.0.260.0030.00316.94
8.0.250.0030.00316.97
8.0.240.0040.00816.93
8.0.230.0000.00716.94
8.0.220.0000.00816.85
8.0.210.0030.00316.97
8.0.200.0060.00316.89
8.0.190.0050.00317.07
8.0.180.0050.00316.96
8.0.170.0040.00416.98
8.0.160.0060.00617.00
8.0.150.0030.00317.00
8.0.140.0000.00716.81
8.0.130.0030.00313.44
8.0.120.0040.00416.84
8.0.110.0000.00717.03
8.0.100.0000.00817.01
8.0.90.0000.00716.91
8.0.80.0070.00716.93
8.0.70.0000.00716.82
8.0.60.0020.00517.03
8.0.50.0040.00416.88
8.0.30.0120.00817.17
8.0.20.0090.01017.41
8.0.10.0040.00417.12
8.0.00.0130.00616.93
7.4.330.0020.00215.55
7.4.320.0030.00316.57
7.4.300.0000.00616.71
7.4.290.0060.00316.50
7.4.280.0000.00816.63
7.4.270.0000.00716.75
7.4.260.0030.00313.41
7.4.250.0040.00416.51
7.4.240.0040.00416.78
7.4.230.0000.00716.84
7.4.220.0100.00716.73
7.4.210.0110.00416.76
7.4.200.0000.00816.48
7.4.160.0080.00816.69
7.4.150.0170.00317.40
7.4.140.0120.00617.86
7.4.130.0090.01216.60
7.4.120.0090.01316.61
7.4.110.0060.01116.41
7.4.100.0060.01316.64
7.4.90.0130.01016.50
7.4.80.0140.00519.39
7.4.70.0070.01016.52
7.4.60.0040.01216.52
7.4.50.0120.00316.46
7.4.40.0090.00916.57
7.4.30.0080.00816.45
7.4.00.0070.01014.88
7.3.330.0050.00213.14
7.3.320.0030.00313.16
7.3.310.0000.00716.46
7.3.300.0040.00416.14
7.3.290.0080.00716.25
7.3.280.0080.00916.27
7.3.270.0100.01017.40
7.3.260.0090.00916.49
7.3.250.0100.00916.31
7.3.240.0080.00816.53
7.3.230.0110.00616.73
7.3.210.0030.01316.65
7.3.200.0150.00616.51
7.3.190.0130.00716.23
7.3.180.0060.01016.66
7.3.170.0070.01016.39
7.3.160.0060.01016.27
7.2.330.0080.01216.68
7.2.320.0080.00916.57
7.2.310.0130.00316.57
7.2.300.0080.00816.45
7.2.290.0130.00316.57
7.2.60.0040.01216.82
7.2.00.0030.01019.41
7.1.200.0060.00915.68
7.1.100.0000.01118.58
7.1.70.0000.01017.39
7.1.60.0970.02033.50
7.1.50.0200.01733.16
7.1.40.0970.01032.63
7.1.30.1070.01332.70
7.1.20.0230.00732.95
7.1.10.0930.01315.10
7.1.00.0200.01014.95
7.0.200.0930.01014.95
7.0.190.0030.01315.15
7.0.180.0000.01314.68
7.0.170.1230.01014.48
7.0.160.0100.01014.45
7.0.150.0930.01714.69
7.0.140.1070.01014.69
7.0.130.0970.01014.73
7.0.120.1100.01314.92
7.0.110.0230.00314.63
7.0.100.0670.01714.55
7.0.90.0770.01014.69
7.0.80.0070.01014.56
7.0.70.0000.01314.50
7.0.60.0030.01314.57
7.0.50.0900.01714.90
7.0.40.0900.01014.89
7.0.30.0870.01314.72
7.0.20.1000.01014.64
7.0.10.1670.01714.79
7.0.00.0100.00714.61

preferences:
55.07 ms | 400 KiB | 5 Q