3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $base = dirname($_SERVER['SCRIPT_NAME']); if (0 === strpos($uri, $base)) { $baseuri = substr($uri, strlen($base)); } var_dump($baseuri);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
Jump found. Position 1 = -2
Branch analysis from position: 25
filename:       /in/VjLBs
function name:  (null)
number of ops:  29
compiled vars:  !0 = $uri, !1 = $base, !2 = $baseuri
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_FCALL                                               'parse_url'
         1        FETCH_R                      global              $3      '_SERVER'
         2        FETCH_DIM_R                                      $4      $3, 'REQUEST_URI'
         3        SEND_VAR                                                 $4
         4        SEND_VAL                                                 5
         5        DO_ICALL                                         $5      
         6        ASSIGN                                                   !0, $5
   4     7        INIT_FCALL                                               'dirname'
         8        FETCH_R                      global              $7      '_SERVER'
         9        FETCH_DIM_R                                      $8      $7, 'SCRIPT_NAME'
        10        SEND_VAR                                                 $8
        11        DO_ICALL                                         $9      
        12        ASSIGN                                                   !1, $9
   6    13        INIT_FCALL                                               'strpos'
        14        SEND_VAR                                                 !0
        15        SEND_VAR                                                 !1
        16        DO_ICALL                                         $11     
        17        IS_IDENTICAL                                     ~12     0, $11
        18      > JMPZ                                                     ~12, ->25
   8    19    >   INIT_FCALL                                               'substr'
        20        SEND_VAR                                                 !0
        21        STRLEN                                           ~13     !1
        22        SEND_VAL                                                 ~13
        23        DO_ICALL                                         $14     
        24        ASSIGN                                                   !2, $14
  11    25    >   INIT_FCALL                                               'var_dump'
        26        SEND_VAR                                                 !2
        27        DO_ICALL                                                 
        28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0