3v4l.org

run code in 300+ PHP versions simultaneously
<?php $expr = '! ^ (?: (?P<scheme> [a-z][a-z0-9.+\-]* ) : )? (?: // (?<authority> (?: (?P<user> [^:@]+ ) (?: : (?P<pass> [^@]+ ) )? @ )? (?P<host> [^:/]+ ) (?: : (?P<port> [0-9]+ ) )? ) )? (?P<path> /[^?#]+ )? (?: \? (?P<query> [^#]+ ) )? (?: # (?P<fragment> .+ ) )? $ !ix'; $urls = [ 'http://host.com/path', 'http://user@host.com/path', 'http://user:pass@host.com/path', 'http://user:pass@host.com:8080/path', '//user:pass@host.com:8080/path', 'http://user:pass@host.com:8080/path?query##fragment', ]; foreach ($urls as $str) { echo "$str\n"; preg_match($expr, $str, $matches); foreach ($matches as $key => $match) { if (!is_int($key) && $match !== '') { echo " " . str_pad("$key:", 10) . " $match\n"; } } echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 37
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 37
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 34
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 34
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 33
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 33
Branch analysis from position: 20
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 34
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/t4hFv
function name:  (null)
number of ops:  39
compiled vars:  !0 = $expr, !1 = $urls, !2 = $str, !3 = $matches, !4 = $match, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%21%0A%5E%0A++++%28%3F%3A%0A++++++++%28%3FP%3Cscheme%3E+%5Ba-z%5D%5Ba-z0-9.%2B%5C-%5D%2A+%29%0A++++++++%3A%0A++++%29%3F%0A++++%28%3F%3A%0A++++++++%2F%2F%0A++++++++%28%3F%3Cauthority%3E%0A++++++++++++%28%3F%3A%0A++++++++++++++++%28%3FP%3Cuser%3E+%5B%5E%3A%40%5D%2B+%29%0A++++++++++++++++%28%3F%3A%0A++++++++++++++++++++%3A%0A++++++++++++++++++++%28%3FP%3Cpass%3E+%5B%5E%40%5D%2B+%29%0A++++++++++++++++%29%3F%0A++++++++++++++++%40%0A++++++++++++%29%3F%0A++++++++++++%28%3FP%3Chost%3E+%5B%5E%3A%2F%5D%2B+%29%0A++++++++++++%28%3F%3A%0A++++++++++++++++%3A%0A++++++++++++++++%28%3FP%3Cport%3E+%5B0-9%5D%2B+%29%0A++++++++++++%29%3F%0A++++++++%29%0A++++%29%3F%0A++++%28%3FP%3Cpath%3E+%2F%5B%5E%3F%23%5D%2B+%29%3F%0A++++%28%3F%3A%0A++++++++%5C%3F%0A++++++++%28%3FP%3Cquery%3E+%5B%5E%23%5D%2B+%29%0A++++%29%3F%0A++++%28%3F%3A%0A++++++++%23%0A++++++++%28%3FP%3Cfragment%3E+.%2B+%29%0A++++%29%3F%0A%24%0A%21ix'
   39     1        ASSIGN                                                   !1, <array>
   48     2      > FE_RESET_R                                       $8      !1, ->37
          3    > > FE_FETCH_R                                               $8, !2, ->37
   49     4    >   NOP                                                      
          5        FAST_CONCAT                                      ~9      !2, '%0A'
          6        ECHO                                                     ~9
   50     7        INIT_FCALL                                               'preg_match'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !2
         10        SEND_REF                                                 !3
         11        DO_ICALL                                                 
   52    12      > FE_RESET_R                                       $11     !3, ->34
         13    > > FE_FETCH_R                                       ~12     $11, !4, ->34
         14    >   ASSIGN                                                   !5, ~12
   53    15        TYPE_CHECK                                   16  ~14     !5
         16        BOOL_NOT                                         ~15     ~14
         17      > JMPZ_EX                                          ~15     ~15, ->20
         18    >   IS_NOT_IDENTICAL                                 ~16     !4, ''
         19        BOOL                                             ~15     ~16
         20    > > JMPZ                                                     ~15, ->33
   54    21    >   INIT_FCALL                                               'str_pad'
         22        NOP                                                      
         23        FAST_CONCAT                                      ~17     !5, '%3A'
         24        SEND_VAL                                                 ~17
         25        SEND_VAL                                                 10
         26        DO_ICALL                                         $18     
         27        CONCAT                                           ~19     '++', $18
         28        ROPE_INIT                                     3  ~21     '+'
         29        ROPE_ADD                                      1  ~21     ~21, !4
         30        ROPE_END                                      2  ~20     ~21, '%0A'
         31        CONCAT                                           ~23     ~19, ~20
         32        ECHO                                                     ~23
   52    33    > > JMP                                                      ->13
         34    >   FE_FREE                                                  $11
   58    35        ECHO                                                     '%0A'
   48    36      > JMP                                                      ->3
         37    >   FE_FREE                                                  $8
   59    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.83 ms | 1400 KiB | 17 Q