3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = array( '123' => array('data' => array('categories' => array( array( 'id' => '2', 'description' => 'Single-player' ), array( 'id' => '1', 'description' => 'Multi-player' ), array( 'id' => '9', 'description' => 'Co-op' ), array( 'id' => '22', 'description' => 'Steam Achievements' ), array( 'id' => '28', 'description' => 'Full controller support' ) )) ), '456' => array('data' => array('categories' => array( array( 'id' => '21', 'description' => 'Downloadable Content' ) )) ), ); //print_r($json); $merged = array(); foreach($json as $j1) { foreach($j1 as $j2) { foreach($j2 as $key => $j3) { foreach($j3 as $j4) { $merged[$key][] = $j4; } } } } print_r($merged);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/X61bE
function name:  (null)
number of ops:  26
compiled vars:  !0 = $json, !1 = $merged, !2 = $j1, !3 = $j2, !4 = $j3, !5 = $key, !6 = $j4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   37     1        ASSIGN                                                   !1, <array>
   38     2      > FE_RESET_R                                       $9      !0, ->21
          3    > > FE_FETCH_R                                               $9, !2, ->21
   40     4    > > FE_RESET_R                                       $10     !2, ->19
          5    > > FE_FETCH_R                                               $10, !3, ->19
   42     6    > > FE_RESET_R                                       $11     !3, ->17
          7    > > FE_FETCH_R                                       ~12     $11, !4, ->17
          8    >   ASSIGN                                                   !5, ~12
   44     9      > FE_RESET_R                                       $14     !4, ->15
         10    > > FE_FETCH_R                                               $14, !6, ->15
   46    11    >   FETCH_DIM_W                                      $15     !1, !5
         12        ASSIGN_DIM                                               $15
         13        OP_DATA                                                  !6
   44    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $14
   42    16      > JMP                                                      ->7
         17    >   FE_FREE                                                  $11
   40    18      > JMP                                                      ->5
         19    >   FE_FREE                                                  $10
   38    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $9
   52    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.07 ms | 1396 KiB | 15 Q