3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('BASE_URL', 'http://localhost:2000/~james/test/'); $in = '/~james/test/sign-in/'; $url = ''; if(isset($in)) $url = http_build_url(BASE_URL, array('path' => $in)); if(!$url) $url = BASE_URL . 'home/'; echo $url;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 15
filename:       /in/PbrkZ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $in, !1 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'BASE_URL'
          2        SEND_VAL                                                 'http%3A%2F%2Flocalhost%3A2000%2F%7Ejames%2Ftest%2F'
          3        DO_ICALL                                                 
    3     4        ASSIGN                                                   !0, '%2F%7Ejames%2Ftest%2Fsign-in%2F'
    4     5        ASSIGN                                                   !1, ''
    6     6        ISSET_ISEMPTY_CV                                         !0
          7      > JMPZ                                                     ~5, ->15
    7     8    >   INIT_FCALL_BY_NAME                                       'http_build_url'
          9        FETCH_CONSTANT                                   ~6      'BASE_URL'
         10        SEND_VAL_EX                                              ~6
         11        INIT_ARRAY                                       ~7      !0, 'path'
         12        SEND_VAL_EX                                              ~7
         13        DO_FCALL                                      0  $8      
         14        ASSIGN                                                   !1, $8
    9    15    >   BOOL_NOT                                         ~10     !1
         16      > JMPZ                                                     ~10, ->20
   10    17    >   FETCH_CONSTANT                                   ~11     'BASE_URL'
         18        CONCAT                                           ~12     ~11, 'home%2F'
         19        ASSIGN                                                   !1, ~12
   11    20    >   ECHO                                                     !1
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.59 ms | 1395 KiB | 15 Q