3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$email = 'johnsnow123@ヒキワリ.ナットウ.fr'; $email = 'johnsnow@192.168.1.1'; $localAndDomain = explode('@', $email); if (count($localAndDomain) !== 2) { echo 'invalid'; return; } $local = $localAndDomain[0]; $localExpression = '^[a-z0-9_-]+(?:[a-z0-9._%+-]+)*$'; if (mb_eregi($localExpression, $local) === false) { echo 'invalid'; return; } // Handle IDN domains $domain = $localAndDomain[1]; $domain = str_replace('xn--', '', idn_to_ascii($domain)); $dictionary = array('aero', 'arpa', 'asia', 'biz', 'cat', 'com', 'coop', 'edu', 'gov', 'info', 'int', 'jobs', 'mil', 'mobi', 'museum', 'name', 'net', 'org', 'pro', 'tel', 'travel'); $domainExpression = '^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[A-Z]{2}|' . implode('|', $dictionary) . ')$'; if (mb_eregi($domainExpression, $domain) === false) { echo 'invalid'; return; } echo 'valid';

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.110.0200.00717.45
7.2.80.0050.00817.27
7.2.60.0060.00917.32
7.2.00.0030.01020.31
7.1.200.0090.01216.25
7.1.100.0030.01318.78
7.1.70.0030.01217.97
7.1.60.0190.00619.46
7.1.50.0120.00417.92
7.1.00.0070.07323.23
7.0.200.0030.00617.94
7.0.140.0100.06722.86
7.0.90.0230.05020.93
7.0.80.0130.07020.70
7.0.70.0170.04020.82
7.0.60.0000.04320.58
7.0.50.0070.04720.92
7.0.40.0000.04020.80
7.0.30.0000.04320.75
7.0.20.0030.06020.75
7.0.10.0000.04320.76
7.0.00.0000.04720.89
5.6.280.0130.06721.86
5.6.230.0030.04321.28
5.6.220.0200.05721.30
5.6.210.0030.04321.41
5.6.200.0030.04021.80
5.6.190.0030.03721.82
5.6.180.0030.04321.82
5.6.170.0070.04721.84
5.6.160.0070.04721.81
5.6.150.0000.04021.91
5.6.140.0030.04321.81
5.6.130.0030.04321.83
5.6.120.0170.07721.76
5.6.110.0030.08721.82
5.6.100.0070.04321.80
5.6.90.0130.04321.66
5.6.80.0100.05321.20
5.6.70.0070.07721.12
5.6.60.0170.06721.09
5.6.50.0130.07721.12
5.6.40.0100.07321.20
5.6.30.0070.04021.13
5.6.20.0070.05721.15
5.6.10.0100.07321.27
5.6.00.0170.07321.12
5.5.370.0130.06721.06
5.5.360.0030.04721.27
5.5.350.0000.04721.00
5.5.340.0030.04721.36
5.5.330.0000.04321.36
5.5.320.0070.04021.49
5.5.310.0070.03721.45
5.5.300.0000.04721.36
5.5.290.0070.04021.42
5.5.280.0000.04021.36
5.5.270.0030.07721.37
5.5.260.0000.06021.57
5.5.250.0070.06021.20
5.5.240.0070.07720.83
5.5.230.0070.04020.85
5.5.220.0130.07020.83
5.5.210.0170.06720.69
5.5.200.0030.09020.83
5.5.190.0100.07020.83
5.5.180.0030.08320.69
5.5.160.0130.07020.86
5.5.150.0100.07320.80
5.5.140.0070.07320.83
5.5.130.0130.07020.86
5.5.120.0030.05020.83
5.5.110.0130.07320.66
5.5.100.0000.07720.79
5.5.90.0000.08720.67
5.5.80.0070.07720.70
5.5.70.0070.07320.73
5.5.60.0070.04020.67
5.5.50.0070.08020.67
5.5.40.0130.05020.58
5.5.30.0130.06020.74
5.5.20.0000.08720.65
5.5.10.0100.07320.70
5.5.00.0200.07020.74
5.4.450.0030.04019.84
5.4.440.0170.06719.91
5.4.430.0130.05719.90
5.4.420.0030.07719.85
5.4.410.0030.04019.69
5.4.400.0130.05319.65
5.4.390.0200.06719.59
5.4.380.0000.07019.51
5.4.370.0100.07019.60
5.4.360.0100.08019.32
5.4.350.0030.08319.37
5.4.340.0000.08319.58
5.4.320.0130.07019.49
5.4.310.0130.07019.54
5.4.300.0130.04719.54
5.4.290.0030.06719.54
5.4.280.0000.08719.39
5.4.270.0030.06019.51
5.4.260.0030.08319.64
5.4.250.0070.06719.52
5.4.240.0000.07319.52
5.4.230.0130.06719.32
5.4.220.0000.06719.41
5.4.210.0070.07019.49
5.4.200.0170.05719.36
5.4.190.0030.08019.52
5.4.180.0200.06319.36
5.4.170.0070.08019.42
5.4.160.0030.04719.54
5.4.150.0070.04019.38
5.4.140.0200.05716.88
5.4.130.0100.05016.88
5.4.120.0130.06716.90
5.4.110.0130.06716.91
5.4.100.0070.04016.71
5.4.90.0030.06716.83
5.4.80.0100.07016.70
5.4.70.0030.06316.91
5.4.60.0130.06016.88
5.4.50.0170.05716.87
5.4.40.0030.06716.88
5.4.30.0100.07016.92
5.4.20.0130.06016.92
5.4.10.0100.06716.83
5.4.00.0200.03016.28
5.3.290.0130.04014.67
5.3.280.0170.06714.56
5.3.270.0030.08314.55
5.3.260.0170.04014.57
5.3.250.0070.04014.60
5.3.240.0130.05014.52
5.3.230.0070.06014.47
5.3.220.0030.06714.54
5.3.210.0100.06714.40
5.3.200.0170.06314.57
5.3.190.0100.03714.56
5.3.180.0100.06014.56
5.3.170.0030.07714.44
5.3.160.0070.04314.39
5.3.150.0100.07014.56
5.3.140.0100.07314.40
5.3.130.0070.06314.52
5.3.120.0130.03314.54
5.3.110.0130.07014.54
5.3.100.0100.06714.04
5.3.90.0100.07014.02
5.3.80.0000.08013.93
5.3.70.0030.07713.98
5.3.60.0170.04013.99
5.3.50.0070.07713.73
5.3.40.0200.06013.92
5.3.30.0070.07013.86
5.3.20.0070.06713.69
5.3.10.0000.06313.60
5.3.00.0100.04713.57
5.2.170.0070.05713.57
5.2.160.0030.06313.57
5.2.150.0130.05013.57
5.2.140.0070.03713.57
5.2.130.0070.03013.57
5.2.120.0030.06013.57
5.2.110.0100.05713.57
5.2.100.0030.06713.57
5.2.90.0130.04713.57
5.2.80.0100.06013.57
5.2.70.0070.05313.57
5.2.60.0000.06313.57
5.2.50.0030.05313.57
5.2.40.0070.06013.57
5.2.30.0100.04013.57
5.2.20.0100.05313.57
5.2.10.0100.06013.57
5.2.00.0070.04013.57
5.1.60.0070.04713.57
5.1.50.0000.03313.57
5.1.40.0030.05313.57
5.1.30.0100.05313.57
5.1.20.0130.04713.57
5.1.10.0100.04313.57
5.1.00.0100.04713.57
5.0.50.0000.04013.57
5.0.40.0070.04013.57
5.0.30.0070.06013.57
5.0.20.0070.03313.57
5.0.10.0030.03713.57
5.0.00.0000.06713.57
4.4.90.0070.03013.57
4.4.80.0030.03313.57
4.4.70.0000.02313.57
4.4.60.0030.03013.57
4.4.50.0000.04013.57
4.4.40.0030.02713.57
4.4.30.0130.02313.57
4.4.20.0070.02313.57
4.4.10.0000.03713.57
4.4.00.0070.05013.57
4.3.110.0030.03013.57
4.3.100.0030.03313.57
4.3.90.0000.03713.57
4.3.80.0070.05013.57
4.3.70.0000.02013.57
4.3.60.0030.03313.57
4.3.50.0030.02313.57
4.3.40.0070.05013.57
4.3.30.0000.03713.57
4.3.20.0030.02713.57
4.3.10.0000.02013.57
4.3.00.0000.03313.57