3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your code goes here $ip = "136be:aa9f:92c0:1806:f54b:09a7:d926:fd55"; $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 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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HXWo2
function name:  (null)
number of ops:  54
compiled vars:  !0 = $ip, !1 = $start, !2 = $ipchk, !3 = $end, !4 = $start2, !5 = $ipchk2, !6 = $end2
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   ASSIGN                                                   !0, '136be%3Aaa9f%3A92c0%3A1806%3Af54b%3A09a7%3Ad926%3Afd55'
   7     1        INIT_FCALL                                               'microtime'
         2        SEND_VAL                                                 <true>
         3        DO_ICALL                                         $8      
         4        ASSIGN                                                   !1, $8
   8     5        INIT_FCALL                                               'preg_match'
         6        SEND_VAL                                                 '%2F%5E%5Cs%2A%28%28%28%5B0-9A-Fa-f%5D%7B1%2C4%7D%3A%29%7B7%7D%28%5B0-9A-Fa-f%5D%7B1%2C4%7D%7C%3A%29%29%7C%28%28%5B0-9A-Fa-f%5D%7B1%2C4%7D%3A%29%7B6%7D%28%3A%5B0-9A-Fa-f%5D%7B1%2C4%7D%7C%28%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%28%5C.%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%29%7B3%7D%29%7C%3A%29%29%7C%28%28%5B0-9A-Fa-f%5D%7B1%2C4%7D%3A%29%7B5%7D%28%28%28%3A%5B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5B1-9%5D%3F%5Cd%29%28%5C.%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%29%7B3%7D%29%29%7C%3A%29%29%7C%28%28%5B0-9A-Fa-f%5D%7B1%2C4%7D%3A%29%7B1%7D%28%28%28%3A%5B0-9A-Fa-f%5D%7B1%2C4%7D%29%7B1%2C6%7D%29%7C%28%28%3A%5B0-9A-Fa-f%5D%7B1%2C4%7D%29%7B0%2C4%7D%3A%28%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%28%5C.%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%29%7B3%7D%29%29%7C%3A%29%29%7C%28%3A%28%28%28%3A%5B0-9A-Fa-f%5D%7B1%2C4%7D%29%7B1%2C7%7D%29%7C%28%28%3A%5B0-9A-Fa-f%5D%7B1%2C4%7D%29%7B0%2C5%7D%3A%28%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%28%5C.%2825%5B0-5%5D%7C2%5B0-4%5D%5Cd%7C1%5Cd%5Cd%7C%5B1-9%5D%3F%5Cd%29%29%7B3%7D%29%29%7C%3A%29%29%29%28%25.%2B%29%3F%5Cs%2A%24%2F'
         7        SEND_VAR                                                 !0
         8        DO_ICALL                                         $10     
         9        BOOL_XOR                                         ~11     $10
        10        BOOL_XOR                                         ~12     ~11
        11        ASSIGN                                                   !2, ~12
   9    12        INIT_FCALL                                               'microtime'
        13        SEND_VAL                                                 <true>
        14        DO_ICALL                                         $14     
        15        ASSIGN                                                   !3, $14
  11    16        INIT_FCALL                                               'microtime'
        17        SEND_VAL                                                 <true>
        18        DO_ICALL                                         $16     
        19        ASSIGN                                                   !4, $16
  12    20        INIT_FCALL                                               'filter_var'
        21        SEND_VAR                                                 !0
        22        SEND_VAL                                                 275
        23        SEND_VAL                                                 2097152
        24        DO_ICALL                                         $18     
        25        BOOL_XOR                                         ~19     $18
        26        BOOL_XOR                                         ~20     ~19
        27        ASSIGN                                                   !5, ~20
  13    28        INIT_FCALL                                               'microtime'
        29        SEND_VAL                                                 <true>
        30        DO_ICALL                                         $22     
        31        ASSIGN                                                   !6, $22
  15    32        ECHO                                                     'preg_match%3A%0A'
  16    33        INIT_FCALL                                               'var_export'
        34        SEND_VAR                                                 !2
        35        SEND_VAL                                                 <true>
        36        DO_ICALL                                         $24     
        37        CONCAT                                           ~25     $24, '%0A'
        38        ECHO                                                     ~25
  17    39        SUB                                              ~26     !3, !1
        40        MUL                                              ~27     ~26, 1000
        41        ECHO                                                     ~27
  18    42        ECHO                                                     '%0A'
  19    43        ECHO                                                     'filter_var%3A%0A'
  20    44        INIT_FCALL                                               'var_export'
        45        SEND_VAR                                                 !5
        46        SEND_VAL                                                 <true>
        47        DO_ICALL                                         $28     
        48        CONCAT                                           ~29     $28, '%0A'
        49        ECHO                                                     ~29
  21    50        SUB                                              ~30     !6, !4
        51        MUL                                              ~31     ~30, 1000
        52        ECHO                                                     ~31
  22    53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
12.73 ms | 416 KiB | 7 Q