3v4l.org

run code in 500+ PHP versions simultaneously
<?php $my_array = array( 0 => array( array( "id" => "121", "slug" => "btm-dc-402" ), array( "id" => "122", "slug" => "btm-dc-403" ), ), 1 => array( array( "id" => "493", "slug" => "jog-buah-401" ), array( "id" => "946", "slug" => "dps-buah-356k" ), ), ); $newArray = []; foreach ($my_array as $key => $value) { foreach($value as $k => $v) { $newArray[] = $v; } } print_r($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/D2pC0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $my_array, !1 = $newArray, !2 = $value, !3 = $key, !4 = $v, !5 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   27     1        ASSIGN                                                       !1, <array>
   29     2      > FE_RESET_R                                           $8      !0, ->13
          3    > > FE_FETCH_R                                           ~9      $8, !2, ->13
          4    >   ASSIGN                                                       !3, ~9
   30     5      > FE_RESET_R                                           $11     !2, ->11
          6    > > FE_FETCH_R                                           ~12     $11, !4, ->11
          7    >   ASSIGN                                                       !5, ~12
   31     8        ASSIGN_DIM                                                   !1
          9        OP_DATA                                                      !4
   30    10      > JMP                                                          ->6
         11    >   FE_FREE                                                      $11
   29    12      > JMP                                                          ->3
         13    >   FE_FREE                                                      $8
   35    14        INIT_FCALL                                                   'print_r'
         15        SEND_VAR                                                     !1
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.29 ms | 1949 KiB | 14 Q