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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.53 ms | 1404 KiB | 23 Q