3v4l.org

run code in 300+ PHP versions simultaneously
<?php $folders = array( 'test/something.txt', 'test/hello.txt', 'test/another-folder/myfile.txt', 'test/another-folder/kamil.txt', 'test/another-folder/john/hi.txt' ); $newFolders = array(); foreach ($folders as $file) { $parts = explode("/", $file); $newFolders[] = array( $parts[0] => $parts[1] ); } var_dump($newFolders);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/nPNYK
function name:  (null)
number of ops:  20
compiled vars:  !0 = $folders, !1 = $newFolders, !2 = $file, !3 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_R                                       $6      !0, ->15
          3    > > FE_FETCH_R                                               $6, !2, ->15
   14     4    >   INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%2F'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
   16     9        FETCH_DIM_R                                      ~10     !3, 0
         10        FETCH_DIM_R                                      ~11     !3, 1
         11        INIT_ARRAY                                       ~12     ~11, ~10
   15    12        ASSIGN_DIM                                               !1
   16    13        OP_DATA                                                  ~12
   13    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
   20    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.42 ms | 1395 KiB | 17 Q