3v4l.org

run code in 500+ PHP versions simultaneously
<?php $multiarr = [ ['Fruit' => 'Apples'], ['Fruit' => 'Bananas'], ['Fruit' => 'Oranges'], ['Veg' => 'Carrot'], //['Veg' => 'Leek'], ]; foreach ($multiarr as $array) { foreach ($array as $key=>$val) { $newarray[$key][] = $val; } } var_export($newarray); echo "\n---\n"; var_export(array_merge_recursive(...$multiarr));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/OMJR1
function name:  (null)
number of ops:  25
compiled vars:  !0 = $multiarr, !1 = $array, !2 = $val, !3 = $key, !4 = $newarray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1      > FE_RESET_R                                           $6      !0, ->12
          2    > > FE_FETCH_R                                                   $6, !1, ->12
   12     3    > > FE_RESET_R                                           $7      !1, ->10
          4    > > FE_FETCH_R                                           ~8      $7, !2, ->10
          5    >   ASSIGN                                                       !3, ~8
   13     6        FETCH_DIM_W                                          $10     !4, !3
          7        ASSIGN_DIM                                                   $10
          8        OP_DATA                                                      !2
   12     9      > JMP                                                          ->4
         10    >   FE_FREE                                                      $7
   11    11      > JMP                                                          ->2
         12    >   FE_FREE                                                      $6
   17    13        INIT_FCALL                                                   'var_export'
         14        SEND_VAR                                                     !4
         15        DO_ICALL                                                     
   19    16        ECHO                                                         '%0A---%0A'
   21    17        INIT_FCALL                                                   'var_export'
         18        INIT_FCALL                                                   'array_merge_recursive'
         19        SEND_UNPACK                                                  !0
         20        CHECK_UNDEF_ARGS                                             
         21        DO_ICALL                                             $13     
         22        SEND_VAR                                                     $13
         23        DO_ICALL                                                     
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.56 ms | 2158 KiB | 14 Q