3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testArray = array( 'percy' => array( 'philip' => array( 'mitch' => array( 'percy' => 'hatcherson', 'mitch' => 'anderson' ) ), 'mitch' => array( 'mitchell', 'anderson', 'percy' => array( 'percy', 'hatcherson' ), 'mitchell' => 'thomas mitchell anderson', 'percy' => 'percy philip hatcherson' ) ) ); $newArray = array(); foreach ($testArray as $k => $v) { if (is_array($v)) { $newArray[] = array_merge($newArray, array_column($v, 'percy')); } } var_dump($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/0qX1j
function name:  (null)
number of ops:  23
compiled vars:  !0 = $testArray, !1 = $newArray, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1        ASSIGN                                                   !1, <array>
   25     2      > FE_RESET_R                                       $6      !0, ->18
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->18
          4    >   ASSIGN                                                   !3, ~7
   27     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~9, ->17
   28     7    >   INIT_FCALL                                               'array_merge'
          8        SEND_VAR                                                 !1
          9        INIT_FCALL                                               'array_column'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 'percy'
         12        DO_ICALL                                         $11     
         13        SEND_VAR                                                 $11
         14        DO_ICALL                                         $12     
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  $12
   25    17    > > JMP                                                      ->3
         18    >   FE_FREE                                                  $6
   34    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.5 ms | 1395 KiB | 19 Q