3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'http://#chrütli24/7schwur.ch'; $input = 'www.meinemüllerdomain.ch/index/checkMe?param#whatevs'; $pattern = array(); $pattern[] = '/\xE2\x80\x8B/'; $pattern[] = '/ /'; $pattern[] = '@^[a-z]+://@i'; $pattern[] = '/&#8203;/'; $pattern[] = '/\?/'; $pattern[] = '@^www\.@i'; // if entered, remove whitespaces, prepending protocoll and www. $cleaned = preg_replace($pattern, null, idn_to_utf8(mb_strtolower($input, 'UTF-8'))); //echo $cleaned; // if entered, remove trailing dot $cleaned = (substr($cleaned, -1) == '.') ? substr($cleaned, 0, -1) : $cleaned; //echo $cleaned; if (strpos($cleaned, '@') !== false) { echo 'false'; } $val = filter_var(idn_to_ascii($cleaned), FILTER_VALIDATE_URL); var_dump($val); $correct = filter_var('http://'.$cleaned, FILTER_VALIDATE_URL); var_dump($correct); //var_dump(parse_url($correct)); $testdomain = idn_to_ascii($cleaned); var_dump(filter_var($testdomain, FILTER_VALIDATE_URL));

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.00717.75
8.3.50.0140.00717.63
8.3.40.0070.00719.97
8.3.30.0110.00419.61
8.3.20.0080.00021.04
8.3.10.0040.00422.64
8.3.00.0030.00620.55
8.2.180.0090.00619.29
8.2.170.0120.00322.96
8.2.160.0060.00922.06
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00422.90
8.2.120.0080.00026.35
8.2.110.0030.00721.91
8.2.100.0060.00618.97
8.2.90.0060.00319.96
8.2.80.0000.00818.80
8.2.70.0030.00618.63
8.2.60.0030.00718.93
8.2.50.0040.00418.91
8.2.40.0080.00021.30
8.2.30.0060.00320.20
8.2.20.0040.00419.05
8.2.10.0000.00719.18
8.2.00.0030.00519.14
8.1.280.0080.00825.92
8.1.270.0000.00824.70
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0000.01024.84
8.1.230.0090.00219.98
8.1.220.0030.00718.55
8.1.210.0080.00018.77
8.1.200.0070.00318.38
8.1.190.0000.00818.35
8.1.180.0040.00418.52
8.1.170.0040.00419.82
8.1.160.0040.00419.89
8.1.150.0000.00822.91
8.1.140.0000.00720.47
8.1.130.0030.00319.82
8.1.120.0000.00718.41
8.1.110.0050.00218.46
8.1.100.0050.00318.52
8.1.90.0030.00618.54
8.1.80.0040.00418.47
8.1.70.0030.00518.42
8.1.60.0050.00318.51
8.1.50.0050.00318.46
8.1.40.0000.00918.57
8.1.30.0000.00918.59
8.1.20.0040.00418.54
8.1.10.0000.00818.40
8.1.00.0040.00418.39
8.0.300.0050.00318.77
8.0.290.0000.00817.63
8.0.280.0000.00719.37
8.0.270.0030.00318.11
8.0.260.0000.00719.87
8.0.250.0040.00417.84
8.0.240.0080.00317.95
8.0.230.0070.00017.83
8.0.220.0050.00217.88
8.0.210.0050.00317.86
8.0.200.0030.00317.94
8.0.190.0040.00417.88
8.0.180.0040.00417.85
8.0.170.0000.00717.97
8.0.160.0040.00417.86
8.0.150.0080.00017.84
8.0.140.0040.00417.96
8.0.130.0050.00013.38
8.0.120.0080.00017.87
8.0.110.0040.00417.92
8.0.100.0040.00417.77
8.0.90.0040.00417.72
8.0.80.0070.01017.71
8.0.70.0000.00817.61
8.0.60.0000.00717.82
8.0.50.0000.00817.88
8.0.30.0100.01118.11
8.0.20.0110.00818.09
8.0.10.0050.00217.71
8.0.00.0070.01117.74
7.4.330.0030.00315.55
7.4.320.0040.00417.48
7.4.300.0000.00717.56
7.4.290.0000.00817.55
7.4.280.0080.00017.66
7.4.270.0000.00717.57
7.4.260.0070.00017.59
7.4.250.0000.00717.48
7.4.240.0040.00417.52
7.4.230.0000.00717.43
7.4.220.0090.00917.69
7.4.210.0140.00717.73
7.4.200.0050.00317.50
7.4.160.0090.00617.59
7.4.150.0070.01117.40
7.4.140.0120.01317.86
7.4.130.0130.00817.48
7.4.120.0100.01317.45
7.4.110.0100.01417.47
7.4.100.0140.00417.50
7.4.90.0090.00917.90
7.4.80.0100.01319.39
7.4.70.0070.01317.39
7.4.60.0100.00617.54
7.4.50.0070.00717.57
7.4.40.0070.01017.61
7.4.30.0200.00317.63
7.4.00.0110.00715.93
7.3.330.0030.00313.08
7.3.320.0060.00013.16
7.3.310.0040.00417.54
7.3.300.0000.00717.64
7.3.290.0060.01017.73
7.3.280.0100.01017.69
7.3.270.0150.00417.65
7.3.260.0130.01317.66
7.3.250.0120.00817.72
7.3.240.0120.00717.73
7.3.230.0110.01017.68
7.3.210.0110.00717.55
7.3.200.0070.01117.58
7.3.190.0180.00317.80
7.3.180.0090.00917.71
7.3.170.0130.00317.65
7.3.160.0130.00417.89
7.3.10.0040.01217.54
7.3.00.0100.00717.53
7.2.330.0100.01017.69
7.2.320.0110.00717.85
7.2.310.0090.01018.04
7.2.300.0060.01217.89
7.2.290.0160.00317.92
7.2.130.0120.00817.89
7.2.120.0110.00517.94
7.2.110.0110.00518.04
7.2.100.0060.00917.84
7.2.90.0090.00817.99
7.2.80.0100.00817.97
7.2.70.0080.01317.94
7.2.60.0040.01117.90
7.2.50.0070.01317.91
7.2.40.0120.00717.91
7.2.30.0030.00918.10
7.2.20.0100.00518.02
7.2.10.0130.00918.16
7.2.00.0060.01018.97
7.1.250.0060.00616.86
7.1.200.0030.01317.17
7.1.70.0000.00818.54
7.1.60.0040.00818.72
7.1.50.0070.01718.30
7.1.40.0400.01332.37
7.1.30.0370.01332.48
7.1.20.0400.02332.59
7.1.10.0270.01716.04
7.1.00.0370.01316.21
7.0.200.0000.02018.10
7.0.180.0300.00715.64
7.0.170.0400.01015.75
7.0.160.0330.01315.64
7.0.150.0270.00715.64
7.0.140.0230.01316.02
7.0.130.0300.01015.87
7.0.120.0330.01015.77
7.0.110.0300.01315.70
7.0.100.0270.01715.54
7.0.90.0430.01015.60
7.0.80.0270.02015.69
7.0.70.0230.01715.73
7.0.60.0300.00715.75
7.0.50.0230.01715.66
7.0.40.0330.01315.88
7.0.30.0330.01316.02
7.0.20.0300.01315.88
7.0.10.0200.01015.83
7.0.00.0230.00715.78

preferences:
52.57 ms | 400 KiB | 5 Q