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'; $input = 'www.jeng.cc'; $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.70.0070.01119.55
8.3.60.0190.00317.63
8.3.50.0170.00521.52
8.3.40.0090.00619.85
8.3.30.0040.01119.64
8.3.20.0000.00821.09
8.3.10.0040.00422.66
8.3.00.0040.00420.06
8.2.190.0160.00017.50
8.2.180.0180.00019.29
8.2.170.0160.00322.96
8.2.160.0040.01122.00
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0060.00322.96
8.2.120.0030.00526.35
8.2.110.0110.00023.00
8.2.100.0000.01118.84
8.2.90.0030.00618.69
8.2.80.0040.00420.35
8.2.70.0060.00318.63
8.2.60.0040.00418.77
8.2.50.0000.00818.55
8.2.40.0000.00923.12
8.2.30.0040.00420.17
8.2.20.0050.00318.74
8.2.10.0070.00019.00
8.2.00.0070.00019.05
8.1.280.0060.00925.92
8.1.270.0040.00424.59
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0120.00624.52
8.1.230.0080.00421.66
8.1.220.0060.00318.39
8.1.210.0000.00819.60
8.1.200.0030.00718.13
8.1.190.0060.00318.23
8.1.180.0030.00518.28
8.1.170.0030.00519.39
8.1.160.0000.00819.57
8.1.150.0000.00822.71
8.1.140.0050.00320.39
8.1.130.0070.00019.75
8.1.120.0050.00218.40
8.1.110.0040.00418.23
8.1.100.0000.00718.28
8.1.90.0000.00818.41
8.1.80.0000.00718.26
8.1.70.0000.00718.36
8.1.60.0030.00618.48
8.1.50.0040.00418.41
8.1.40.0030.00618.46
8.1.30.0040.00418.53
8.1.20.0030.00618.45
8.1.10.0030.00618.42
8.1.00.0040.00418.34
8.0.300.0040.00420.90
8.0.290.0000.00717.75
8.0.280.0000.00719.20
8.0.270.0000.00718.04
8.0.260.0030.00319.73
8.0.250.0050.00317.65
8.0.240.0030.00617.71
8.0.230.0000.00717.67
8.0.220.0040.00417.61
8.0.210.0000.00717.66
8.0.200.0000.00717.70
8.0.190.0070.00017.78
8.0.180.0070.00017.75
8.0.170.0070.00017.79
8.0.160.0030.00517.89
8.0.150.0000.00817.80
8.0.140.0050.00317.79
8.0.130.0030.00313.41
8.0.120.0040.00417.75
8.0.110.0040.00417.69
8.0.100.0000.00717.77
8.0.90.0000.00817.78
8.0.80.0000.01617.82
8.0.70.0040.00417.79
8.0.60.0000.00717.64
8.0.50.0070.00017.75
8.0.30.0080.01118.00
8.0.20.0080.01118.02
8.0.10.0000.00817.86
8.0.00.0070.01117.53
7.4.330.0000.00615.55
7.4.320.0000.00617.56
7.4.300.0000.00617.49
7.4.290.0070.00017.46
7.4.280.0000.00817.54
7.4.270.0040.00417.54
7.4.260.0000.01017.48
7.4.250.0000.00717.53
7.4.240.0000.00717.46
7.4.230.0040.00417.34
7.4.220.0090.00917.49
7.4.210.0110.00917.43
7.4.200.0000.00717.39
7.4.160.0140.00917.41
7.4.150.0060.01317.52
7.4.140.0070.01617.86
7.4.130.0090.01117.38
7.4.120.0100.01217.36
7.4.110.0150.00317.31
7.4.100.0100.01017.29
7.4.90.0060.01317.42
7.4.80.0110.00619.39
7.4.70.0110.00817.30
7.4.60.0140.00317.52
7.4.50.0070.00717.22
7.4.40.0070.01017.42
7.4.30.0060.01617.50
7.4.00.0060.00915.84
7.3.330.0030.00313.06
7.3.320.0050.00013.10
7.3.310.0000.00717.33
7.3.300.0000.00717.26
7.3.290.0070.00817.25
7.3.280.0070.01217.19
7.3.270.0170.00317.40
7.3.260.0230.01217.13
7.3.250.0130.00617.34
7.3.240.0150.00217.25
7.3.230.0100.00717.32
7.3.210.0040.01217.17
7.3.200.0150.00417.22
7.3.190.0120.00817.38
7.3.180.0090.01117.38
7.3.170.0110.00617.23
7.3.160.0120.00417.25
7.2.330.0120.00617.30
7.2.320.0090.01317.41
7.2.310.0100.00617.47
7.2.300.0150.00317.61
7.2.290.0130.00317.45
7.2.60.0000.01017.72
7.2.00.0030.01020.30
7.1.200.0040.01116.58
7.1.70.0050.00318.18
7.1.60.0120.00618.42
7.1.50.0050.01818.07
7.1.40.0430.01732.41
7.1.30.0430.01732.49
7.1.20.1570.01732.51
7.1.10.0230.00715.70
7.1.00.0200.01015.75
7.0.200.0040.01417.73
7.0.180.0230.01315.40
7.0.170.0170.01015.14
7.0.160.0400.01015.29
7.0.150.0230.01715.38
7.0.140.0300.00715.51
7.0.130.0300.01715.42
7.0.120.0270.00315.44
7.0.110.0170.01315.30
7.0.100.0200.01315.07
7.0.90.0200.01715.34
7.0.80.0200.01315.35
7.0.70.0230.01015.37
7.0.60.0270.00315.40
7.0.50.0130.01715.28
7.0.40.0200.00715.52
7.0.30.0230.00715.52
7.0.20.0200.01015.63
7.0.10.0230.00315.43
7.0.00.0230.01315.54

preferences:
60.91 ms | 401 KiB | 5 Q