3v4l.org

run code in 300+ PHP versions simultaneously
<?php $baseuri = $uri = parse_url('http://test.com/start/par/1/2/3', PHP_URL_PATH); $base = dirname('/start/index.php'); if (0 === strpos($uri, $base)) { $baseuri = substr($uri, strlen($base)); } var_dump($baseuri);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/ISmoP
function name:  (null)
number of ops:  26
compiled vars:  !0 = $baseuri, !1 = $uri, !2 = $base
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'parse_url'
          1        SEND_VAL                                                 'http%3A%2F%2Ftest.com%2Fstart%2Fpar%2F1%2F2%2F3'
          2        SEND_VAL                                                 5
          3        DO_ICALL                                         $3      
          4        ASSIGN                                           ~4      !1, $3
          5        ASSIGN                                                   !0, ~4
    4     6        INIT_FCALL                                               'dirname'
          7        SEND_VAL                                                 '%2Fstart%2Findex.php'
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
    6    10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14        IS_IDENTICAL                                             $8, 0
         15      > JMPZ                                                     ~9, ->22
    8    16    >   INIT_FCALL                                               'substr'
         17        SEND_VAR                                                 !1
         18        STRLEN                                           ~10     !2
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                         $11     
         21        ASSIGN                                                   !0, $11
   11    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.54 ms | 1387 KiB | 23 Q