3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['file'] = '/etc/passwd'; #https://twitter.com/ramal_h #file compressor header('Content-type: text/css'); ob_start("compress"); function compress( $minify ) { $minify = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $minify ); $minify = str_replace( array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $minify ); return $minify; } $file = $_GET['file']; if( ($file == '') || (strpos($file, '../') !== false)) exit('Hacking attempt'); else include $_GET['file']; ob_end_flush();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/rpSMe
function name:  (null)
number of ops:  29
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $1      '_GET'
          1        ASSIGN_DIM                                               $1, 'file'
          2        OP_DATA                                                  '%2Fetc%2Fpasswd'
    7     3        INIT_FCALL                                               'header'
          4        SEND_VAL                                                 'Content-type%3A+text%2Fcss'
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'ob_start'
          7        SEND_VAL                                                 'compress'
          8        DO_ICALL                                                 
   17     9        FETCH_R                      global              ~5      '_GET'
         10        FETCH_DIM_R                                      ~6      ~5, 'file'
         11        ASSIGN                                                   !0, ~6
   18    12        IS_EQUAL                                         ~8      !0, ''
         13      > JMPNZ_EX                                         ~8      ~8, ->20
         14    >   INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 '..%2F'
         17        DO_ICALL                                         $9      
         18        TYPE_CHECK                                  1018  ~10     $9
         19        BOOL                                             ~8      ~10
         20    > > JMPZ                                                     ~8, ->23
   19    21    > > EXIT                                                     'Hacking+attempt'
         22*       JMP                                                      ->26
   21    23    >   FETCH_R                      global              ~11     '_GET'
         24        FETCH_DIM_R                                      ~12     ~11, 'file'
         25        INCLUDE_OR_EVAL                                          ~12, INCLUDE
   23    26        INIT_FCALL                                               'ob_end_flush'
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function compress:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rpSMe
function name:  compress
number of ops:  15
compiled vars:  !0 = $minify
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%21%2F%5C%2A%5B%5E%2A%5D%2A%5C%2A%2B%28%5B%5E%2F%5D%5B%5E%2A%5D%2A%5C%2A%2B%29%2A%2F%21'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        ASSIGN                                                   !0, $1
   14     7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 <array>
          9        SEND_VAL                                                 ''
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $3      
         12        ASSIGN                                                   !0, $3
   15    13      > RETURN                                                   !0
   16    14*     > RETURN                                                   null

End of function compress

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.54 ms | 1400 KiB | 25 Q