3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=array('0_1','0_3','1_2','1_1','4_1'); $newArray = []; foreach ($arr as $item) { $items = explode('_', $item); $newArray[$items[0]][$items[1]] = $item; } var_dump($newArray); exit();
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 = 79) Position 1 = -2
Branch analysis from position: 15
filename:       /in/gbVjO
function name:  (null)
number of ops:  21
compiled vars:  !0 = $arr, !1 = $newArray, !2 = $item, !3 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $6      !0, ->15
          3    > > FE_FETCH_R                                               $6, !2, ->15
    6     4    >   INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '_'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    7     9        FETCH_DIM_R                                      ~9      !3, 0
         10        FETCH_DIM_R                                      ~11     !3, 1
         11        FETCH_DIM_W                                      $10     !1, ~9
         12        ASSIGN_DIM                                               $10, ~11
         13        OP_DATA                                                  !2
    5    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
    9    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   10    19      > EXIT                                                     
         20*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.38 ms | 1386 KiB | 17 Q