3v4l.org

run code in 300+ PHP versions simultaneously
<?php // no separator $dir = '/tmp/'; ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); $fp = fopen('/tmp/hhvm-openbasedir-test', 'w'); if ($fp) { print("Opened!\n"); fclose($fb); } else print("Failed to open\n"); // with separator $dir = dirname(PHP_BINARY); ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); $fp = fopen('/tmp/hhvm-openbasedir-test', 'w'); if ($fp) { print("Opened!\n"); fclose($fb); } else print("Failed to open\n"); // with separator $dir = '/tmp/'.PATH_SEPARATOR.dirname(PHP_BINARY); ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); $fp = fopen('/tmp/hhvm-openbasedir-test', 'w'); if ($fp) { print("Opened!\n"); fclose($fb); } else print("Failed to open\n");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 66
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 66
Branch analysis from position: 61
Branch analysis from position: 66
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
Branch analysis from position: 42
filename:       /in/7DmQe
function name:  (null)
number of ops:  68
compiled vars:  !0 = $dir, !1 = $fp, !2 = $fb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%2Ftmp%2F'
    5     1        INIT_FCALL                                               'ini_set'
          2        SEND_VAL                                                 'open_basedir'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5        CONCAT                                           ~5      'ini_set+to+', !0
          6        CONCAT                                           ~6      ~5, '%0A'
          7        ECHO                                                     ~6
    7     8        INIT_FCALL                                               'fopen'
          9        SEND_VAL                                                 '%2Ftmp%2Fhhvm-openbasedir-test'
         10        SEND_VAL                                                 'w'
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !1, $7
    8    13      > JMPZ                                                     !1, ->19
    9    14    >   ECHO                                                     'Opened%21%0A'
   10    15        INIT_FCALL                                               'fclose'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > JMP                                                      ->20
   11    19    >   ECHO                                                     'Failed+to+open%0A'
   15    20    >   INIT_FCALL                                               'dirname'
         21        SEND_VAL                                                 '%2Fusr%2Fbin%2Fphp-8.0.0'
         22        DO_ICALL                                         $10     
         23        ASSIGN                                                   !0, $10
   16    24        INIT_FCALL                                               'ini_set'
         25        SEND_VAL                                                 'open_basedir'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
   17    28        CONCAT                                           ~13     'ini_set+to+', !0
         29        CONCAT                                           ~14     ~13, '%0A'
         30        ECHO                                                     ~14
   18    31        INIT_FCALL                                               'fopen'
         32        SEND_VAL                                                 '%2Ftmp%2Fhhvm-openbasedir-test'
         33        SEND_VAL                                                 'w'
         34        DO_ICALL                                         $15     
         35        ASSIGN                                                   !1, $15
   19    36      > JMPZ                                                     !1, ->42
   20    37    >   ECHO                                                     'Opened%21%0A'
   21    38        INIT_FCALL                                               'fclose'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                                 
         41      > JMP                                                      ->43
   22    42    >   ECHO                                                     'Failed+to+open%0A'
   25    43    >   INIT_FCALL                                               'dirname'
         44        SEND_VAL                                                 '%2Fusr%2Fbin%2Fphp-8.0.0'
         45        DO_ICALL                                         $18     
         46        CONCAT                                           ~19     '%2Ftmp%2F%3A', $18
         47        ASSIGN                                                   !0, ~19
   26    48        INIT_FCALL                                               'ini_set'
         49        SEND_VAL                                                 'open_basedir'
         50        SEND_VAR                                                 !0
         51        DO_ICALL                                                 
   27    52        CONCAT                                           ~22     'ini_set+to+', !0
         53        CONCAT                                           ~23     ~22, '%0A'
         54        ECHO                                                     ~23
   28    55        INIT_FCALL                                               'fopen'
         56        SEND_VAL                                                 '%2Ftmp%2Fhhvm-openbasedir-test'
         57        SEND_VAL                                                 'w'
         58        DO_ICALL                                         $24     
         59        ASSIGN                                                   !1, $24
   29    60      > JMPZ                                                     !1, ->66
   30    61    >   ECHO                                                     'Opened%21%0A'
   31    62        INIT_FCALL                                               'fclose'
         63        SEND_VAR                                                 !2
         64        DO_ICALL                                                 
         65      > JMP                                                      ->67
   32    66    >   ECHO                                                     'Failed+to+open%0A'
         67    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.14 ms | 1392 KiB | 21 Q