3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your code goes here $ip = "16be:aa9f:92c0:1806:f54b:09a7:d926:3d55"; $start = microtime(true); $ipchk = !!preg_match("/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/", $ip); $end = microtime(true); $start2 = microtime(true); $ipchk2 = !!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6); $end2 = microtime(true); echo "preg_match:\n"; echo ($end - $start) * 1000; echo "\n"; echo "filter_var:\n"; echo ($end2 - $start2) * 1000;

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.1.120.0000.00819.03
8.1.110.0150.00019.13
8.1.100.0130.00319.05
8.1.90.0160.00019.04
8.1.80.0100.00719.11
8.1.70.0070.00719.11
8.1.60.0030.00819.18
8.1.50.0100.00719.09
8.1.40.0170.00319.12
8.1.30.0110.00719.05
8.1.20.0150.00319.21
8.1.10.0210.00019.04
8.1.00.0110.00818.88
8.0.250.0090.00618.47
8.0.240.0110.00418.34
8.0.230.0090.00618.42
8.0.220.0120.00418.33
8.0.210.0070.00718.29
8.0.200.0050.01018.34
8.0.190.0150.00018.44
8.0.180.0100.00518.43
8.0.170.0110.00418.37
8.0.160.0070.00718.30
8.0.150.0160.00018.37
8.0.140.0140.00018.41
8.0.130.0100.00518.36
8.0.120.0110.00418.36
8.0.110.0120.00418.36
8.0.100.0100.00718.28
8.0.90.0050.01118.33
8.0.80.0110.00418.37
8.0.70.0030.00818.28
8.0.60.0090.00318.24
8.0.50.0080.00818.21
8.0.30.0040.01118.36
8.0.20.0070.00418.25
8.0.10.0000.01218.38
8.0.00.0120.00417.83
7.4.330.0000.00714.08
7.4.320.0070.00317.82
7.4.300.0110.00018.04
7.4.290.0070.00418.02
7.4.280.0040.00717.91
7.4.270.0100.00318.06
7.4.260.0060.00617.98
7.4.250.0100.00318.07
7.4.240.0100.00817.94
7.4.230.0090.00418.09
7.4.220.0090.00517.96
7.4.210.0090.00618.01
7.4.200.0140.00017.94
7.4.190.0080.00317.96
7.4.180.0030.00918.07
7.4.160.0120.00017.88
7.4.150.0000.01318.03
7.4.140.0000.01517.91
7.4.130.0160.00217.56
7.4.120.0050.01517.34
7.4.110.0090.01017.46
7.4.100.0100.00617.46
7.4.90.0140.00417.37
7.4.80.0100.00617.45
7.4.70.0060.01117.41
7.4.60.0110.00417.39
7.4.50.0120.00817.48
7.4.40.0050.01117.30
7.4.30.0080.00717.29
7.4.20.0080.00917.37
7.4.10.0080.00517.31
7.4.00.0100.00317.22
7.3.330.0070.00717.73
7.3.320.0100.00517.68
7.3.310.0140.00017.68
7.3.300.0150.00017.66
7.3.290.0140.00417.59
7.3.280.0130.00217.63
7.3.270.0120.00317.60
7.3.260.0100.00517.68
7.3.250.0070.00917.20
7.3.240.0140.00317.33
7.3.230.0080.00917.30
7.3.220.0120.00417.31
7.3.210.0080.00917.35
7.3.200.0080.00817.29
7.3.190.0030.01217.17
7.3.180.0090.00717.16
7.3.170.0090.00717.30
7.3.160.0100.00617.22
7.3.150.0120.00517.29
7.3.140.0130.00417.18
7.3.130.0130.00317.21
7.3.120.0060.01017.08
7.3.110.0140.00317.05
7.3.100.0120.00817.17
7.3.90.0080.00717.41
7.3.80.0110.00517.19
7.3.70.0130.00517.30
7.3.60.0100.00517.23
7.3.50.0030.01417.32
7.3.40.0060.00817.29
7.3.30.0130.00317.26
7.3.20.0070.00918.06
7.3.10.0090.00718.17
7.3.00.0130.00318.21

preferences:
30.07 ms | 401 KiB | 5 Q