3v4l.org

run code in 300+ PHP versions simultaneously
<?php static $root; if (!isset($root)) { $root = $_SERVER['DOCUMENT_ROOT']; if ( substr( $root, -1, 1 ) != '/' ) { $root .= '/'; } } return $root; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 15
filename:       /in/OSNKU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $root
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    4     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->15
    6     4    >   FETCH_R                      global              ~3      '_SERVER'
          5        FETCH_DIM_R                                      ~4      ~3, 'DOCUMENT_ROOT'
          6        ASSIGN                                                   !0, ~4
    7     7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 -1
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $6      
         12        IS_NOT_EQUAL                                             $6, '%2F'
         13      > JMPZ                                                     ~7, ->15
    8    14    >   ASSIGN_OP                                     8          !0, '%2F'
   12    15    > > RETURN                                                   !0
   13    16*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.55 ms | 939 KiB | 16 Q