3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc_arr = array("second" => array( array("position" => 4, "content" => "Valiant"), array("position" => 5, "content" => "Hail") ), "first" => array( array("position" => 0, "content" => "Hail"), array("position" => 3, "content" => "Victors"), array("position" => 2, "content" => "the"), array("position" => 1, "content" => "to") ) ); $idxar=array(); foreach ($assoc_arr as $subar) foreach ($subar as $item) $idxar[$item['position']+0]=$item['content']; print_r($idxar);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/5FRub
function name:  (null)
number of ops:  19
compiled vars:  !0 = $assoc_arr, !1 = $idxar, !2 = $subar, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   21     1        ASSIGN                                                   !1, <array>
   22     2      > FE_RESET_R                                       $6      !0, ->14
          3    > > FE_FETCH_R                                               $6, !2, ->14
   23     4    > > FE_RESET_R                                       $7      !2, ->12
          5    > > FE_FETCH_R                                               $7, !3, ->12
   24     6    >   FETCH_DIM_R                                      ~8      !3, 'position'
          7        ADD                                              ~9      ~8, 0
          8        FETCH_DIM_R                                      ~11     !3, 'content'
          9        ASSIGN_DIM                                               !1, ~9
         10        OP_DATA                                                  ~11
   23    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $7
   22    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $6
   26    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.7 ms | 1395 KiB | 15 Q