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; $position=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); } $offset=$position; //if (preg_match('/^\s*\((?P<name>.*)/s', $value, $match)) {7 $name = $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; } print_r($match); $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 = 19, Position 2 = 39
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 44
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 44
Branch analysis from position: 75
Branch analysis from position: 44
Branch analysis from position: 39
Branch analysis from position: 7
filename:       /in/GA8ZO
function name:  (null)
number of ops:  99
compiled vars:  !0 = $content, !1 = $match, !2 = $offset, !3 = $position, !4 = $name, !5 = $value, !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        ASSIGN                                                   !3, 0
   11     9        INIT_FCALL                                               'preg_match'
         10        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'
         11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        DO_ICALL                                         $14     
         15        SEND_VAR                                                 $14
         16        SEND_REF                                                 !1
         17        DO_ICALL                                         $15     
         18      > JMPZ                                                     $15, ->39
   13    19    >   INIT_FCALL                                               'ltrim'
         20        FETCH_DIM_R                                      ~16     !1, 'name'
         21        SEND_VAL                                                 ~16
         22        SEND_VAL                                                 '%2F'
         23        DO_ICALL                                         $17     
         24        ASSIGN                                                   !4, $17
   14    25        FETCH_DIM_R                                      ~19     !1, 'value'
         26        ASSIGN                                                   !5, ~19
   15    27        INIT_FCALL                                               'strpos'
         28        SEND_VAR                                                 !0
         29        SEND_VAR                                                 !5
         30        FETCH_DIM_R                                      ~21     !1, 'name'
         31        STRLEN                                           ~22     ~21
         32        ADD                                              ~23     !3, ~22
         33        SEND_VAL                                                 ~23
         34        DO_ICALL                                         $24     
         35        ASSIGN                                                   !3, $24
   16    36        INIT_FCALL                                               'print_r'
         37        SEND_VAR                                                 !3
         38        DO_ICALL                                                 
   18    39    >   ASSIGN                                                   !2, !3
   21    40        ASSIGN                                                   !4, !4
   23    41        ASSIGN                                           ~29     !7, 0
         42        ASSIGN                                                   !6, ~29
   24    43      > JMP                                                      ->67
   25    44    >   INIT_FCALL                                               'substr'
         45        SEND_VAR                                                 !4
         46        SEND_VAR                                                 !6
         47        SUB                                              ~31     !9, !6
         48        SEND_VAL                                                 ~31
         49        DO_ICALL                                         $32     
         50        ASSIGN                                                   !8, $32
   26    51        INIT_FCALL                                               'preg_match'
         52        SEND_VAL                                                 '%2F%28%3FP%3Cescape%3E%5B%5C%5C%5D%2A%29%24%2Fs'
         53        SEND_VAR                                                 !8
         54        SEND_REF                                                 !1
         55        DO_ICALL                                                 
   27    56        FETCH_DIM_R                                      ~35     !1, 'escape'
         57        STRLEN                                           ~36     ~35
         58        MOD                                              ~37     ~36, 2
         59        BOOL_NOT                                         ~38     ~37
         60      > JMPZ                                                     ~38, ->62
   28    61    > > JMP                                                      ->75
   30    62    >   INIT_FCALL                                               'print_r'
         63        SEND_VAR                                                 !1
         64        DO_ICALL                                                 
   31    65        ADD                                              ~40     !9, 1
         66        ASSIGN                                                   !7, ~40
   24    67    >   INIT_FCALL                                               'strpos'
         68        SEND_VAR                                                 !4
         69        SEND_VAL                                                 '%29'
         70        SEND_VAR                                                 !7
         71        DO_ICALL                                         $42     
         72        ASSIGN                                           ~43     !9, $42
         73        TYPE_CHECK                                  1018          ~43
         74      > JMPNZ                                                    ~44, ->44
   35    75    >   INIT_FCALL                                               'substr'
         76        SEND_VAR                                                 !4
         77        SEND_VAL                                                 0
         78        SEND_VAR                                                 !9
         79        DO_ICALL                                         $45     
         80        ASSIGN                                                   !4, $45
   36    81        INIT_FCALL                                               'strpos'
         82        SEND_VAR                                                 !0
         83        SEND_VAL                                                 '%28'
         84        DO_ICALL                                         $47     
         85        ADD                                              ~48     $47, !9
         86        ADD                                              ~49     ~48, 2
         87        ASSIGN_OP                                     1          !2, ~49
   37    88        INIT_FCALL                                               'str_replace'
   38    89        SEND_VAL                                                 <array>
   39    90        SEND_VAL                                                 <array>
   40    91        SEND_VAR                                                 !4
         92        DO_ICALL                                         $51     
   37    93        ASSIGN                                                   !4, $51
   42    94        INIT_FCALL                                               'print_r'
         95        SEND_VAR                                                 !4
         96        DO_ICALL                                                 
   45    97        ECHO                                                     'test'
         98      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.95 ms | 1396 KiB | 25 Q