3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your code goes here $ip = "40.83.109.300"; $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: false 0.17690658569336 filter_var: false 0.0030994415283203
Output for 7.4.13
preg_match: false 0.22196769714355 filter_var: false 0.0040531158447266
Output for 7.4.12
preg_match: false 0.18215179443359 filter_var: false 0.0050067901611328
Output for 7.4.11
preg_match: false 0.21600723266602 filter_var: false 0.003814697265625
Output for 7.4.10
preg_match: false 0.1828670501709 filter_var: false 0.0040531158447266
Output for 7.4.9
preg_match: false 0.25820732116699 filter_var: false 0.018835067749023
Output for 7.4.8
preg_match: false 0.25391578674316 filter_var: false 0.0050067901611328
Output for 7.4.7
preg_match: false 0.17595291137695 filter_var: false 0.0047683715820312
Output for 7.4.6
preg_match: false 0.18596649169922 filter_var: false 0.0059604644775391
Output for 7.4.5
preg_match: false 0.17809867858887 filter_var: false 0.0050067901611328
Output for 7.4.4
preg_match: false 0.2131462097168 filter_var: false 0.0050067901611328
Output for 7.4.3
preg_match: false 0.24509429931641 filter_var: false 0.0040531158447266
Output for 7.4.2
preg_match: false 0.18000602722168 filter_var: false 0.0050067901611328
Output for 7.4.1
preg_match: false 0.17213821411133 filter_var: false 0.003814697265625
Output for 7.4.0
preg_match: false 0.18191337585449 filter_var: false 0.0050067901611328
Output for 7.3.25
preg_match: false 0.17905235290527 filter_var: false 0.003814697265625
Output for 7.3.24
preg_match: false 0.20003318786621 filter_var: false 0.0040531158447266
Output for 7.3.6, 7.3.23
preg_match: false 0.17905235290527 filter_var: false 0.0050067901611328
Output for 7.3.22
preg_match: false 0.23293495178223 filter_var: false 0.0040531158447266
Output for 7.3.21
preg_match: false 0.20503997802734 filter_var: false 0.0050067901611328
Output for 7.3.20
preg_match: false 0.17714500427246 filter_var: false 0.0040531158447266
Output for 7.3.19
preg_match: false 0.22315979003906 filter_var: false 0.003814697265625
Output for 7.3.18
preg_match: false 0.26416778564453 filter_var: false 0.0059604644775391
Output for 7.3.17
preg_match: false 0.1990795135498 filter_var: false 0.0040531158447266
Output for 7.3.16
preg_match: false 0.24795532226562 filter_var: false 0.0047683715820312
Output for 7.3.15
preg_match: false 0.24509429931641 filter_var: false 0.0050067901611328
Output for 7.3.14
preg_match: false 0.18692016601562 filter_var: false 0.0050067901611328
Output for 7.3.13
preg_match: false 0.30899047851562 filter_var: false 0.0050067901611328
Output for 7.3.12
preg_match: false 0.21600723266602 filter_var: false 0.0040531158447266
Output for 7.3.11
preg_match: false 0.41890144348145 filter_var: false 0.0050067901611328
Output for 7.3.10
preg_match: false 0.20885467529297 filter_var: false 0.0050067901611328
Output for 7.3.9
preg_match: false 0.18501281738281 filter_var: false 0.0040531158447266
Output for 7.3.8
preg_match: false 0.74601173400879 filter_var: false 0.16999244689941
Output for 7.3.7
preg_match: false 0.18692016601562 filter_var: false 0.003814697265625
Output for 7.3.5
preg_match: false 0.20194053649902 filter_var: false 0.0050067901611328
Output for 7.3.4
preg_match: false 0.43296813964844 filter_var: false 0.0050067901611328
Output for 7.3.3
preg_match: false 0.16999244689941 filter_var: false 0.0050067901611328
Output for 7.3.2
preg_match: false 0.16093254089355 filter_var: false 0.0050067901611328
Output for 7.3.1
preg_match: false 0.18787384033203 filter_var: false 0.0050067901611328
Output for 7.3.0
preg_match: false 0.21195411682129 filter_var: false 0.0040531158447266

preferences:
25.39 ms | 464 KiB | 5 Q