3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [ 1 => [ 1 => [ 'anna', 'alice' ], 2 => [ 'bob', 'bartold' ] ], 2 => [ 1 => [ 'carol' ], 2 => [ 'david' ] ] ]; $result = []; foreach ($array as $key => $arr) { foreach ($arr as $k => $v) { $result[$k] = $v; } } var_dump($result);
based on NQL45
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
Jump found. Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
Jump found. Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
Jump found. Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
Jump found. Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 11
Jump found. Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 13
Jump found. Position 1 = -2
Branch analysis from position: 13
filename:       /in/38rS3
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $result, !2 = $arr, !3 = $key, !4 = $v, !5 = $k
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  13     0  E >   ASSIGN                                                   !0, <array>
  24     1        ASSIGN                                                   !1, <array>
  25     2      > FE_RESET_R                                       $8      !0, ->13
         3    > > FE_FETCH_R                                       ~9      $8, !2, ->13
         4    >   ASSIGN                                                   !3, ~9
  26     5      > FE_RESET_R                                       $11     !2, ->11
         6    > > FE_FETCH_R                                               $11, !4, ->11
         7    >   ASSIGN                                                   !5, ~12
  27     8        ASSIGN_DIM                                               !1, !5
         9        OP_DATA                                                  !4
        10      > JMP                                                      ->6
        11    >   FE_FREE                                                  $11
        12      > JMP                                                      ->3
        13    >   FE_FREE                                                  $8
  31    14        INIT_FCALL                                               'var_dump'
        15        SEND_VAR                                                 !1
        16        DO_ICALL                                                 
        17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0