3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scandir = "home:///Pierpaolo/file.txt"; $scandir = preg_replace("/\/$/", "", $scandir); $scandir = preg_replace("/\/\.\.\/?/", "/", $scandir); $scandir = preg_replace("/\/$/", "", $scandir); echo $scandir; if ( (preg_match("/^([A-z0-9\-_]+)?\:\/\/?(.*)/", $scandir, $matches)) !== false ) { if ( sizeof($matches) === 3 ) { $protocol = "{$matches[1]}://"; $dirname = $matches[2]; } } echo $protocol." - ".$dirname ;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 36
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 36
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 36
filename:       /in/22nCU
function name:  (null)
number of ops:  40
compiled vars:  !0 = $scandir, !1 = $matches, !2 = $protocol, !3 = $dirname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'home%3A%2F%2F%2FPierpaolo%2Ffile.txt'
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5C%2F%24%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    6     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%5C%2F%5C.%5C.%5C%2F%3F%2F'
          9        SEND_VAL                                                 '%2F'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
    7    13        INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%5C%2F%24%2F'
         15        SEND_VAL                                                 ''
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !0, $9
    9    19        ECHO                                                     !0
   12    20        INIT_FCALL                                               'preg_match'
         21        SEND_VAL                                                 '%2F%5E%28%5BA-z0-9%5C-_%5D%2B%29%3F%5C%3A%5C%2F%5C%2F%3F%28.%2A%29%2F'
         22        SEND_VAR                                                 !0
         23        SEND_REF                                                 !1
         24        DO_ICALL                                         $11     
         25        TYPE_CHECK                                  1018          $11
         26      > JMPZ                                                     ~12, ->36
   13    27    >   COUNT                                            ~13     !1
         28        IS_IDENTICAL                                             ~13, 3
         29      > JMPZ                                                     ~14, ->36
   14    30    >   FETCH_DIM_R                                      ~15     !1, 1
         31        NOP                                                      
         32        FAST_CONCAT                                      ~16     ~15, '%3A%2F%2F'
         33        ASSIGN                                                   !2, ~16
   15    34        FETCH_DIM_R                                      ~18     !1, 2
         35        ASSIGN                                                   !3, ~18
   19    36    >   CONCAT                                           ~20     !2, '+-+'
         37        CONCAT                                           ~21     ~20, !3
         38        ECHO                                                     ~21
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.88 ms | 1400 KiB | 17 Q