3v4l.org

run code in 300+ PHP versions simultaneously
<?php function set($value) { error_reporting(E_ALL); print("Trying to set $value..."); $before = ini_get("open_basedir"); $result = ini_set('open_basedir', $value); if ($result) { print("Success!\n"); } else { print("Failure\n"); print(error_get_last()); } print($before." => ".ini_get('open_basedir')."\n"); } set('/tmp/a'.PATH_SEPARATOR.'/tmp/b/c'); set('/tmp/a/b'); set('/tmp/c');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lgpja
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'set'
          1        SEND_VAL                                                 '%2Ftmp%2Fa%3A%2Ftmp%2Fb%2Fc'
          2        DO_FCALL                                      0          
   18     3        INIT_FCALL                                               'set'
          4        SEND_VAL                                                 '%2Ftmp%2Fa%2Fb'
          5        DO_FCALL                                      0          
   19     6        INIT_FCALL                                               'set'
          7        SEND_VAL                                                 '%2Ftmp%2Fc'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lgpja
function name:  set
number of ops:  32
compiled vars:  !0 = $value, !1 = $before, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'error_reporting'
          2        SEND_VAL                                                 32767
          3        DO_ICALL                                                 
    5     4        ROPE_INIT                                     3  ~5      'Trying+to+set+'
          5        ROPE_ADD                                      1  ~5      ~5, !0
          6        ROPE_END                                      2  ~4      ~5, '...'
          7        ECHO                                                     ~4
    6     8        INIT_FCALL                                               'ini_get'
          9        SEND_VAL                                                 'open_basedir'
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
    7    12        INIT_FCALL                                               'ini_set'
         13        SEND_VAL                                                 'open_basedir'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
    8    17      > JMPZ                                                     !2, ->20
    9    18    >   ECHO                                                     'Success%21%0A'
         19      > JMP                                                      ->24
   11    20    >   ECHO                                                     'Failure%0A'
   12    21        INIT_FCALL                                               'error_get_last'
         22        DO_ICALL                                         $11     
         23        ECHO                                                     $11
   14    24    >   CONCAT                                           ~12     !1, '+%3D%3E+'
         25        INIT_FCALL                                               'ini_get'
         26        SEND_VAL                                                 'open_basedir'
         27        DO_ICALL                                         $13     
         28        CONCAT                                           ~14     ~12, $13
         29        CONCAT                                           ~15     ~14, '%0A'
         30        ECHO                                                     ~15
   15    31      > RETURN                                                   null

End of function set

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.9 ms | 1403 KiB | 24 Q