3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server['REQUEST_URI'] = '/index.php?x/'; $server['HTTP_HOST'] = 'neos.dev'; $host = isset($server['HTTP_HOST']) ? $server['HTTP_HOST'] : 'localhost'; $requestUri = isset($server['REQUEST_URI']) ? $server['REQUEST_URI'] : '/'; $requestUri = str_replace('/index.php', '', $requestUri); $uriString = 'http://' . $host . $requestUri; $uriParts = parse_url($uriString); var_dump($uriParts['host']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
Branch analysis from position: 16
filename:       /in/OlMTh
function name:  (null)
number of ops:  36
compiled vars:  !0 = $server, !1 = $host, !2 = $requestUri, !3 = $uriString, !4 = $uriParts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 'REQUEST_URI'
          1        OP_DATA                                                  '%2Findex.php%3Fx%2F'
    3     2        ASSIGN_DIM                                               !0, 'HTTP_HOST'
          3        OP_DATA                                                  'neos.dev'
    5     4        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'HTTP_HOST'
          5      > JMPZ                                                     ~7, ->9
          6    >   FETCH_DIM_R                                      ~8      !0, 'HTTP_HOST'
          7        QM_ASSIGN                                        ~9      ~8
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~9      'localhost'
         10    >   ASSIGN                                                   !1, ~9
    6    11        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'REQUEST_URI'
         12      > JMPZ                                                     ~11, ->16
         13    >   FETCH_DIM_R                                      ~12     !0, 'REQUEST_URI'
         14        QM_ASSIGN                                        ~13     ~12
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~13     '%2F'
         17    >   ASSIGN                                                   !2, ~13
    7    18        INIT_FCALL                                               'str_replace'
         19        SEND_VAL                                                 '%2Findex.php'
         20        SEND_VAL                                                 ''
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $15     
         23        ASSIGN                                                   !2, $15
    8    24        CONCAT                                           ~17     'http%3A%2F%2F', !1
         25        CONCAT                                           ~18     ~17, !2
         26        ASSIGN                                                   !3, ~18
   10    27        INIT_FCALL                                               'parse_url'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $20     
         30        ASSIGN                                                   !4, $20
   11    31        INIT_FCALL                                               'var_dump'
         32        FETCH_DIM_R                                      ~22     !4, 'host'
         33        SEND_VAL                                                 ~22
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.09 ms | 1400 KiB | 19 Q