3v4l.org

run code in 500+ PHP versions simultaneously
<?php $queryParamsPath = 'Indoformosa/Folder1/SubFolder1'; $parts = explode('/', $queryParamsPath); $links = []; $path = ''; foreach ($parts as $part) { $links[] = [ 'label' => $part, 'url' => $path . $part, ]; $path .= $part . '/'; } print_r($links);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/Y6dSc
function name:  (null)
number of ops:  23
compiled vars:  !0 = $queryParamsPath, !1 = $parts, !2 = $links, !3 = $path, !4 = $part
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Indoformosa%2FFolder1%2FSubFolder1'
    5     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%2F'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    6     6        ASSIGN                                                       !2, <array>
    7     7        ASSIGN                                                       !3, ''
    8     8      > FE_RESET_R                                           $10     !1, ->18
          9    > > FE_FETCH_R                                                   $10, !4, ->18
   10    10    >   INIT_ARRAY                                           ~12     !4, 'label'
   11    11        CONCAT                                               ~13     !3, !4
         12        ADD_ARRAY_ELEMENT                                    ~12     ~13, 'url'
    9    13        ASSIGN_DIM                                                   !2
   11    14        OP_DATA                                                      ~12
   13    15        CONCAT                                               ~14     !4, '%2F'
         16        ASSIGN_OP                                         8          !3, ~14
    8    17      > JMP                                                          ->9
         18    >   FE_FREE                                                      $10
   16    19        INIT_FCALL                                                   'print_r'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.51 ms | 1943 KiB | 15 Q