3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Address = "/clanek/12345/komentare"; $Map = array( "/clanky" => "Clanky.php", "/clanek/([^/]*)" => "Blog.php", "/clanek/([^/]*)/komentare" => "Blog.php", "/" => "Main.php" ); foreach ($Map as $Key => $Value) { if (preg_match('~^'.str_replace('~', '\~', $Key).'$~', $Address, $Matches)) { echo "Obsauje: $Key\n"; var_dump($Matches); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 26
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 26
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/rHJVH
function name:  (null)
number of ops:  28
compiled vars:  !0 = $Address, !1 = $Map, !2 = $Value, !3 = $Key, !4 = $Matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fclanek%2F12345%2Fkomentare'
    5     1        ASSIGN                                                   !1, <array>
   12     2      > FE_RESET_R                                       $7      !1, ->26
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->26
          4    >   ASSIGN                                                   !3, ~8
   13     5        INIT_FCALL                                               'preg_match'
          6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '%7E'
          8        SEND_VAL                                                 '%5C%7E'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $10     
         11        CONCAT                                           ~11     '%7E%5E', $10
         12        CONCAT                                           ~12     ~11, '%24%7E'
         13        SEND_VAL                                                 ~12
         14        SEND_VAR                                                 !0
         15        SEND_REF                                                 !4
         16        DO_ICALL                                         $13     
         17      > JMPZ                                                     $13, ->25
   14    18    >   ROPE_INIT                                     3  ~15     'Obsauje%3A+'
         19        ROPE_ADD                                      1  ~15     ~15, !3
         20        ROPE_END                                      2  ~14     ~15, '%0A'
         21        ECHO                                                     ~14
   15    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
   12    25    > > JMP                                                      ->3
         26    >   FE_FREE                                                  $7
   17    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.61 ms | 1396 KiB | 19 Q