3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = <<<CODE ff\\bunction f() {} CODE; $funcs_internal = get_defined_functions()['internal']; /* lets allow some secure funcs here */ unset ($funcs_internal[array_search('strlen', $funcs_internal)]); unset ($funcs_internal[array_search('print', $funcs_internal)]); unset ($funcs_internal[array_search('strcmp', $funcs_internal)]); unset ($funcs_internal[array_search('strncmp', $funcs_internal)]); $funcs_extra = array ('eval', 'include', 'require', 'function'); $funny_chars = array ('\.', '\+', '-', '\*', '"', '`', '\[', '\]'); $variables = array ('_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_FILES', '_ENV', 'HTTP_ENV_VARS', '_SESSION', 'GLOBALS'); $blacklist = array_merge($funcs_internal, $funcs_extra, $funny_chars, $variables); $insecure = false; foreach ($blacklist as $blacklisted) { if (preg_match ('/' . $blacklisted . '/im', $code)) { $insecure = $blacklisted; break; } } if ($insecure) { var_dump($insecure); } else { eval ($code); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 48
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 48
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 54
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 48
Branch analysis from position: 48
filename:       /in/MJCWE
function name:  (null)
number of ops:  56
compiled vars:  !0 = $code, !1 = $funcs_internal, !2 = $funcs_extra, !3 = $funny_chars, !4 = $variables, !5 = $blacklist, !6 = $insecure, !7 = $blacklisted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'ff%5Cbunction+f%28%29+%7B%7D'
    7     1        INIT_FCALL                                               'get_defined_functions'
          2        DO_ICALL                                         $9      
          3        FETCH_DIM_R                                      ~10     $9, 'internal'
          4        ASSIGN                                                   !1, ~10
   10     5        INIT_FCALL                                               'array_search'
          6        SEND_VAL                                                 'strlen'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $12     
          9        UNSET_DIM                                                !1, $12
   11    10        INIT_FCALL                                               'array_search'
         11        SEND_VAL                                                 'print'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $13     
         14        UNSET_DIM                                                !1, $13
   12    15        INIT_FCALL                                               'array_search'
         16        SEND_VAL                                                 'strcmp'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $14     
         19        UNSET_DIM                                                !1, $14
   13    20        INIT_FCALL                                               'array_search'
         21        SEND_VAL                                                 'strncmp'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $15     
         24        UNSET_DIM                                                !1, $15
   15    25        ASSIGN                                                   !2, <array>
   16    26        ASSIGN                                                   !3, <array>
   17    27        ASSIGN                                                   !4, <array>
   19    28        INIT_FCALL                                               'array_merge'
         29        SEND_VAR                                                 !1
         30        SEND_VAR                                                 !2
         31        SEND_VAR                                                 !3
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $19     
         34        ASSIGN                                                   !5, $19
   21    35        ASSIGN                                                   !6, <false>
   22    36      > FE_RESET_R                                       $22     !5, ->48
         37    > > FE_FETCH_R                                               $22, !7, ->48
   23    38    >   INIT_FCALL                                               'preg_match'
         39        CONCAT                                           ~23     '%2F', !7
         40        CONCAT                                           ~24     ~23, '%2Fim'
         41        SEND_VAL                                                 ~24
         42        SEND_VAR                                                 !0
         43        DO_ICALL                                         $25     
         44      > JMPZ                                                     $25, ->47
   24    45    >   ASSIGN                                                   !6, !7
   25    46      > JMP                                                      ->48
   22    47    > > JMP                                                      ->37
         48    >   FE_FREE                                                  $22
   29    49      > JMPZ                                                     !6, ->54
   30    50    >   INIT_FCALL                                               'var_dump'
         51        SEND_VAR                                                 !6
         52        DO_ICALL                                                 
   29    53      > JMP                                                      ->55
   32    54    >   INCLUDE_OR_EVAL                                          !0, EVAL
   33    55    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.31 ms | 1007 KiB | 18 Q