3v4l.org

run code in 500+ PHP versions simultaneously
<?php $urls = [ 'https://example.com/api/', 'https://www.example.com/test-subpath', 'https://www.example.com', 'example.com/test/page', 'www.example.com', 'www.subdomain.example.com', 'https://www.subdomain.example.com', 'subdomain.example.com', 'http://subdomain.example.com', 'https://subdomain.example.com', ]; function checkUrl(string $url): bool { return (bool)filter_var($url, FILTER_VALIDATE_URL); } foreach ($urls as $url) { if (checkUrl($url)) { echo $url . ' is a valid URL' . PHP_EOL; continue; } $urlWithProtocol = 'https://' . $url; if (checkUrl($urlWithProtocol)) { echo $urlWithProtocol . ' with added protocol is a valid URL' . PHP_EOL; continue; } echo $url . ' is not a valid URL' . PHP_EOL; }

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.30.0110.00621.23
8.5.20.0070.01020.18
8.5.10.0110.00616.55
8.5.00.0140.00820.05
8.4.180.0100.01319.66
8.4.170.0040.00623.76
8.4.160.0120.01123.92
8.4.150.0070.00516.89
8.4.140.0130.00817.68
8.4.130.0110.00917.96
8.4.120.0050.00320.82
8.4.110.0100.00922.38
8.4.100.0100.01117.54
8.4.90.0080.01317.53
8.4.80.0050.00418.00
8.4.70.0100.01017.91
8.4.60.0100.01020.70
8.4.50.0170.00317.55
8.4.40.0070.01417.45
8.4.30.0070.01518.68
8.4.20.0130.00719.43
8.4.10.0050.00319.36
8.3.300.0080.00319.34
8.3.290.0110.00920.21
8.3.280.0140.00618.50
8.3.270.0110.00916.38
8.3.260.0110.00816.65
8.3.250.0070.00119.16
8.3.240.0030.00516.67
8.3.230.0140.00516.76
8.3.220.0110.00617.12
8.3.210.0110.00916.41
8.3.200.0100.00616.41
8.3.190.0110.01017.35
8.3.180.0120.00716.59
8.3.170.0120.00619.08
8.3.160.0120.00616.59
8.3.150.0100.01019.11
8.3.140.0050.01016.36
8.3.130.0040.01118.48
8.3.120.0100.00019.09
8.3.110.0040.00418.36
8.3.100.0040.00718.18
8.3.90.0300.00826.77
8.3.80.0480.00426.77
8.3.70.0430.01426.77
8.3.60.0480.00326.77
8.3.50.0290.01926.77
8.3.40.0370.00026.77
8.3.30.0250.00226.77
8.3.20.0280.00026.77
8.3.10.0260.00426.77
8.3.00.0130.00526.77
8.2.300.0130.01019.78
8.2.290.0130.00520.54
8.2.280.0120.00720.21
8.2.270.0040.00419.21
8.2.260.0050.00516.54
8.2.250.0060.00316.66
8.2.240.0040.00417.10
8.2.230.0080.00820.94
8.2.220.0030.00624.06
8.2.210.0220.00426.77
8.2.200.0160.01226.77
8.2.190.0230.00326.77
8.2.180.0140.00526.77
8.2.170.0150.00426.77
8.2.160.0150.00426.77
8.2.150.0200.00026.77
8.2.140.0260.00026.77
8.2.130.0270.00726.77
8.2.120.0300.01326.77
8.2.110.0350.00826.77
8.2.100.0310.00326.77
8.2.90.0400.00326.77
8.2.80.0280.01426.77
8.2.70.0310.01026.77
8.2.60.0220.02026.77
8.2.50.0350.00726.77
8.2.40.0330.00626.77
8.2.30.0350.00726.77
8.2.20.0310.00826.77
8.2.10.0290.00626.77
8.2.00.0260.00826.77
8.1.340.0090.01417.55
8.1.330.0110.00716.61
8.1.320.0060.00316.36
8.1.310.0090.00016.92
8.1.300.0030.00616.33
8.1.290.0350.00626.77
8.1.280.0340.00626.77
8.1.270.0370.00826.77
8.1.260.0370.00626.77
8.1.250.0320.01126.77
8.1.240.0360.00326.77
8.1.230.0310.00726.77
8.1.220.0270.01226.77
8.1.210.0280.00926.77
8.1.200.0260.00926.77
8.1.190.0210.01526.77
8.1.180.0350.00326.77
8.1.170.0350.00326.77
8.1.160.0250.01426.77
8.1.150.0430.00626.77
8.1.140.0320.00726.77
8.1.130.0250.01226.77
8.1.120.0260.00926.77
8.1.110.0300.00826.77
8.1.100.0240.01226.77
8.1.90.0270.00826.77
8.1.80.0350.00326.77
8.1.70.0350.00426.77
8.1.60.0350.00626.77
8.1.50.0330.00826.77
8.1.40.0350.00626.77
8.1.30.0330.00926.77
8.1.20.0440.00326.77
8.1.10.0400.00426.77
8.1.00.0340.00326.77

preferences:
44.24 ms | 1044 KiB | 5 Q