3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "http://www.unl.edu/path/path/index.php?test"; $parts = parse_url($url); if (isset($parts['path'])) { $pathinfo = pathinfo($parts['path']); if (isset($pathinfo['extension'])) { $parts['path'] = basename($parts['path']); } unset($parts['query']); unset($parts['fragment']); } print_r($parts);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 22
filename:       /in/velWe
function name:  (null)
number of ops:  26
compiled vars:  !0 = $url, !1 = $parts, !2 = $pathinfo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.unl.edu%2Fpath%2Fpath%2Findex.php%3Ftest'
    4     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    6     5        ISSET_ISEMPTY_DIM_OBJ                         0          !1, 'path'
          6      > JMPZ                                                     ~6, ->22
    7     7    >   INIT_FCALL                                               'pathinfo'
          8        FETCH_DIM_R                                      ~7      !1, 'path'
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
    8    12        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'extension'
         13      > JMPZ                                                     ~10, ->20
    9    14    >   INIT_FCALL                                               'basename'
         15        FETCH_DIM_R                                      ~12     !1, 'path'
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                         $13     
         18        ASSIGN_DIM                                               !1, 'path'
         19        OP_DATA                                                  $13
   12    20    >   UNSET_DIM                                                !1, 'query'
   13    21        UNSET_DIM                                                !1, 'fragment'
   16    22    >   INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.15 ms | 1395 KiB | 21 Q