3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uri = 'temp://foo/bar.txt'; $uri_path1 = array_slice(explode('/', $uri), 2, -1); $uri_path2 = explode('/', $uri); array_shift($uri_path2); array_shift($uri_path2); array_pop($uri_path2); var_dump($uri_path1); var_dump($uri_path2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0nBZM
function name:  (null)
number of ops:  32
compiled vars:  !0 = $uri, !1 = $uri_path1, !2 = $uri_path2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'temp%3A%2F%2Ffoo%2Fbar.txt'
    5     1        INIT_FCALL                                               'array_slice'
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2F'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 2
          8        SEND_VAL                                                 -1
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
    7    11        INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '%2F'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !2, $7
    8    16        INIT_FCALL                                               'array_shift'
         17        SEND_REF                                                 !2
         18        DO_ICALL                                                 
    9    19        INIT_FCALL                                               'array_shift'
         20        SEND_REF                                                 !2
         21        DO_ICALL                                                 
   10    22        INIT_FCALL                                               'array_pop'
         23        SEND_REF                                                 !2
         24        DO_ICALL                                                 
   12    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
   13    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
290.96 ms | 1015 KiB | 18 Q