3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your code goes here $ip = "40.83.109.202"; $start = microtime(true); $ipchk = !!preg_match("/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/", $ip); $end = microtime(true); $start2 = microtime(true); $ipchk2 = !!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); $end2 = microtime(true); echo "preg_match:\n"; echo var_export($ipchk, true) . "\n"; echo ($end - $start) * 1000; echo "\n"; echo "filter_var:\n"; echo var_export($ipchk2, true) . "\n"; echo ($end2 - $start2) * 1000;
Output for 8.0.0
preg_match: true 0.20599365234375 filter_var: true 0.0040531158447266
Output for 7.4.13
preg_match: true 0.22697448730469 filter_var: true 0.0050067901611328
Output for 7.4.12
preg_match: true 0.42009353637695 filter_var: true 0.0050067901611328
Output for 7.4.11
preg_match: true 0.20313262939453 filter_var: true 0.003814697265625
Output for 7.4.10
preg_match: true 0.22387504577637 filter_var: true 0.003814697265625
Output for 7.4.9
preg_match: true 0.19407272338867 filter_var: true 0.0040531158447266
Output for 7.4.8
preg_match: true 0.18000602722168 filter_var: true 0.003814697265625
Output for 7.4.7
preg_match: true 0.25701522827148 filter_var: true 0.0059604644775391
Output for 7.4.6
preg_match: true 0.22983551025391 filter_var: true 0.0050067901611328
Output for 7.4.5
preg_match: true 0.17380714416504 filter_var: true 0.003814697265625
Output for 7.4.4
preg_match: true 0.30112266540527 filter_var: true 0.0050067901611328
Output for 7.4.3
preg_match: true 0.17404556274414 filter_var: true 0.0040531158447266
Output for 7.4.2
preg_match: true 0.17499923706055 filter_var: true 0.0050067901611328
Output for 7.4.1
preg_match: true 0.19001960754395 filter_var: true 0.0050067901611328
Output for 7.4.0
preg_match: true 0.21219253540039 filter_var: true 0.0047683715820312
Output for 7.3.25
preg_match: true 0.20003318786621 filter_var: true 0.0069141387939453
Output for 7.3.24
preg_match: true 0.19598007202148 filter_var: true 0.0050067901611328
Output for 7.3.23
preg_match: true 0.33807754516602 filter_var: true 0.0050067901611328
Output for 7.3.22
preg_match: true 0.2291202545166 filter_var: true 0.0050067901611328
Output for 7.3.21
preg_match: true 0.23508071899414 filter_var: true 0.0050067901611328
Output for 7.3.20
preg_match: true 0.24700164794922 filter_var: true 0.0050067901611328
Output for 7.3.19
preg_match: true 0.1828670501709 filter_var: true 0.0050067901611328
Output for 7.3.18
preg_match: true 1.4557838439941 filter_var: true 0.0040531158447266
Output for 7.3.17
preg_match: true 0.22792816162109 filter_var: true 0.0059604644775391
Output for 7.3.16
preg_match: true 0.26512145996094 filter_var: true 0.0050067901611328
Output for 7.3.15
preg_match: true 0.1838207244873 filter_var: true 0.0050067901611328
Output for 7.3.14
preg_match: true 0.26202201843262 filter_var: true 0.0040531158447266
Output for 7.3.13
preg_match: true 0.24509429931641 filter_var: true 0.0050067901611328
Output for 7.3.12
preg_match: true 0.20885467529297 filter_var: true 0.0040531158447266
Output for 7.3.11
preg_match: true 0.24604797363281 filter_var: true 0.0050067901611328
Output for 7.3.10
preg_match: true 0.17309188842773 filter_var: true 0.0050067901611328
Output for 7.3.9
preg_match: true 0.18692016601562 filter_var: true 0.0040531158447266
Output for 7.3.8
preg_match: true 0.20599365234375 filter_var: true 0.0059604644775391
Output for 7.3.7
preg_match: true 0.17309188842773 filter_var: true 0.0040531158447266
Output for 7.3.1, 7.3.6
preg_match: true 0.17094612121582 filter_var: true 0.0050067901611328
Output for 7.3.5
preg_match: true 0.16212463378906 filter_var: true 0.0040531158447266
Output for 7.3.4
preg_match: true 0.20694732666016 filter_var: true 0.0050067901611328
Output for 7.3.3
preg_match: true 0.1678466796875 filter_var: true 0.0040531158447266
Output for 7.3.2
preg_match: true 0.22602081298828 filter_var: true 0.0050067901611328
Output for 7.3.0
preg_match: true 0.16999244689941 filter_var: true 0.0040531158447266

preferences:
21.66 ms | 464 KiB | 5 Q