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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.92 ms | 1409 KiB | 25 Q