3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '/NameType /FlateDecode /Contents[4 0 R 42]/Fonts<</F1 41/F2 43>>/NullType null/StringType(hello))/DateType(D:20130901235555+02\'00\')/XRefType 2 0 R /NumericType 8/HexaType<0020>/BooleanType false'; if (preg_match('/^\s*\((?P<name>.*)/s', $content, $match)) { } $offset=0; if (preg_match('/^\s*(?P<name>\/[A-Z0-9\._]+)(?P<value>.*)/si', substr($content, 0), $match)) { $name = ltrim($match['name'], '/'); $value = $match['value']; $position = strpos($content, $value, $position + strlen($match['name'])); print_r($position); } if (preg_match('/^\s*\((?P<name>.*)/s', $content, $match)) { $name = $match['name']; // Find next ')' not escaped. $cur_start_text = $start_search_end = 0; while (($cur_start_pos = strpos($name, ')/', $start_search_end)) !== false) { $cur_extract = substr($name, $cur_start_text, $cur_start_pos - $cur_start_text); preg_match('/(?P<escape>[\\\]*)$/s', $cur_extract, $match); if (!(strlen($match['escape']) % 2)) { break; } $start_search_end = $cur_start_pos + 1; } // Extract string. $name = substr($name, 0, $cur_start_pos); $offset += strpos($content, '(') + $cur_start_pos + 2; // 2 for '(' and ')' $name = str_replace( array('\\\\', '\\ ', '\\/', '\(', '\)', '\n', '\r', '\t'), array('\\', ' ', '/', '(', ')', "\n", "\r", "\t"), $name ); print_r($name); } // your code goes here echo "test";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 38
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 99
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 77, Position 2 = 49
Branch analysis from position: 77
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 67
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 77, Position 2 = 49
Branch analysis from position: 77
Branch analysis from position: 49
Branch analysis from position: 99
Branch analysis from position: 38
Branch analysis from position: 7
filename:       /in/iUEWo
function name:  (null)
number of ops:  101
compiled vars:  !0 = $content, !1 = $match, !2 = $offset, !3 = $name, !4 = $value, !5 = $position, !6 = $cur_start_text, !7 = $start_search_end, !8 = $cur_extract, !9 = $cur_start_pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2FNameType+%2FFlateDecode%0A++++++++%2FContents%5B4+0+R+42%5D%2FFonts%3C%3C%2FF1+41%2FF2+43%3E%3E%2FNullType%0A++++++++null%2FStringType%28hello%29%29%2FDateType%28D%3A20130901235555%2B02%2700%27%29%2FXRefType+2+0+R%0A++++++++%2FNumericType+8%2FHexaType%3C0020%3E%2FBooleanType+false'
    6     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%5Cs%2A%5C%28%28%3FP%3Cname%3E.%2A%29%2Fs'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $11     
          6      > JMPZ                                                     $11, ->7
    9     7    >   ASSIGN                                                   !2, 0
   10     8        INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%2F%5E%5Cs%2A%28%3FP%3Cname%3E%5C%2F%5BA-Z0-9%5C._%5D%2B%29%28%3FP%3Cvalue%3E.%2A%29%2Fsi'
         10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $13     
         14        SEND_VAR                                                 $13
         15        SEND_REF                                                 !1
         16        DO_ICALL                                         $14     
         17      > JMPZ                                                     $14, ->38
   12    18    >   INIT_FCALL                                               'ltrim'
         19        FETCH_DIM_R                                      ~15     !1, 'name'
         20        SEND_VAL                                                 ~15
         21        SEND_VAL                                                 '%2F'
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !3, $16
   13    24        FETCH_DIM_R                                      ~18     !1, 'value'
         25        ASSIGN                                                   !4, ~18
   14    26        INIT_FCALL                                               'strpos'
         27        SEND_VAR                                                 !0
         28        SEND_VAR                                                 !4
         29        FETCH_DIM_R                                      ~20     !1, 'name'
         30        STRLEN                                           ~21     ~20
         31        ADD                                              ~22     !5, ~21
         32        SEND_VAL                                                 ~22
         33        DO_ICALL                                         $23     
         34        ASSIGN                                                   !5, $23
   15    35        INIT_FCALL                                               'print_r'
         36        SEND_VAR                                                 !5
         37        DO_ICALL                                                 
   17    38    >   INIT_FCALL                                               'preg_match'
         39        SEND_VAL                                                 '%2F%5E%5Cs%2A%5C%28%28%3FP%3Cname%3E.%2A%29%2Fs'
         40        SEND_VAR                                                 !0
         41        SEND_REF                                                 !1
         42        DO_ICALL                                         $26     
         43      > JMPZ                                                     $26, ->99
   19    44    >   FETCH_DIM_R                                      ~27     !1, 'name'
         45        ASSIGN                                                   !3, ~27
   21    46        ASSIGN                                           ~29     !7, 0
         47        ASSIGN                                                   !6, ~29
   22    48      > JMP                                                      ->69
   23    49    >   INIT_FCALL                                               'substr'
         50        SEND_VAR                                                 !3
         51        SEND_VAR                                                 !6
         52        SUB                                              ~31     !9, !6
         53        SEND_VAL                                                 ~31
         54        DO_ICALL                                         $32     
         55        ASSIGN                                                   !8, $32
   24    56        INIT_FCALL                                               'preg_match'
         57        SEND_VAL                                                 '%2F%28%3FP%3Cescape%3E%5B%5C%5C%5D%2A%29%24%2Fs'
         58        SEND_VAR                                                 !8
         59        SEND_REF                                                 !1
         60        DO_ICALL                                                 
   25    61        FETCH_DIM_R                                      ~35     !1, 'escape'
         62        STRLEN                                           ~36     ~35
         63        MOD                                              ~37     ~36, 2
         64        BOOL_NOT                                         ~38     ~37
         65      > JMPZ                                                     ~38, ->67
   26    66    > > JMP                                                      ->77
   28    67    >   ADD                                              ~39     !9, 1
         68        ASSIGN                                                   !7, ~39
   22    69    >   INIT_FCALL                                               'strpos'
         70        SEND_VAR                                                 !3
         71        SEND_VAL                                                 '%29%2F'
         72        SEND_VAR                                                 !7
         73        DO_ICALL                                         $41     
         74        ASSIGN                                           ~42     !9, $41
         75        TYPE_CHECK                                  1018          ~42
         76      > JMPNZ                                                    ~43, ->49
   32    77    >   INIT_FCALL                                               'substr'
         78        SEND_VAR                                                 !3
         79        SEND_VAL                                                 0
         80        SEND_VAR                                                 !9
         81        DO_ICALL                                         $44     
         82        ASSIGN                                                   !3, $44
   33    83        INIT_FCALL                                               'strpos'
         84        SEND_VAR                                                 !0
         85        SEND_VAL                                                 '%28'
         86        DO_ICALL                                         $46     
         87        ADD                                              ~47     $46, !9
         88        ADD                                              ~48     ~47, 2
         89        ASSIGN_OP                                     1          !2, ~48
   34    90        INIT_FCALL                                               'str_replace'
   35    91        SEND_VAL                                                 <array>
   36    92        SEND_VAL                                                 <array>
   37    93        SEND_VAR                                                 !3
         94        DO_ICALL                                         $50     
   34    95        ASSIGN                                                   !3, $50
   39    96        INIT_FCALL                                               'print_r'
         97        SEND_VAR                                                 !3
         98        DO_ICALL                                                 
   42    99    >   ECHO                                                     'test'
        100      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.38 ms | 1404 KiB | 25 Q