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 " $key: $match\n"; } } echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 31
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 31
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 28
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 = 27
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 27
Branch analysis from position: 20
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 28
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/tfKPF
function name:  (null)
number of ops:  33
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.%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%3F%3A%0A++++++++%2F%0A++++++++%28%3FP%3Cpath%3E+%2F%5B%5E%3F%23%5D%2B%3F+%29%0A++++%29%3F%0A++++%28%3F%3A%0A++++++++%5C%3F%0A++++++++%28%3FP%3Cquery%3E+%5B%5E%23%5D%2B%3F+%29%0A++++%29%3F%0A++++%28%3F%3A%0A++++++++%23%0A++++++++%28%3FP%3Cfragment%3E+.%2B+%29%0A++++%29%3F%0A%24%0A%21ix'
   42     1        ASSIGN                                                   !1, <array>
   51     2      > FE_RESET_R                                       $8      !1, ->31
          3    > > FE_FETCH_R                                               $8, !2, ->31
   52     4    >   NOP                                                      
          5        FAST_CONCAT                                      ~9      !2, '%0A'
          6        ECHO                                                     ~9
   53     7        INIT_FCALL                                               'preg_match'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !2
         10        SEND_REF                                                 !3
         11        DO_ICALL                                                 
   55    12      > FE_RESET_R                                       $11     !3, ->28
         13    > > FE_FETCH_R                                       ~12     $11, !4, ->28
         14    >   ASSIGN                                                   !5, ~12
   56    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, ->27
   57    21    >   ROPE_INIT                                     5  ~18     '++'
         22        ROPE_ADD                                      1  ~18     ~18, !5
         23        ROPE_ADD                                      2  ~18     ~18, '%3A+'
         24        ROPE_ADD                                      3  ~18     ~18, !4
         25        ROPE_END                                      4  ~17     ~18, '%0A'
         26        ECHO                                                     ~17
   55    27    > > JMP                                                      ->13
         28    >   FE_FREE                                                  $11
   61    29        ECHO                                                     '%0A'
   51    30      > JMP                                                      ->3
         31    >   FE_FREE                                                  $8
   62    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.1 ms | 1400 KiB | 15 Q