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) { $newArray[] = array_column($v, 'percy'); 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 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/hqEte
function name:  (null)
number of ops:  29
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>
   26     2      > FE_RESET_R                                       $6      !0, ->24
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->24
          4    >   ASSIGN                                                   !3, ~7
   28     5        INIT_FCALL                                               'array_column'
          6        SEND_VAR                                                 !2
          7        SEND_VAL                                                 'percy'
          8        DO_ICALL                                         $10     
          9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  $10
   30    11        TYPE_CHECK                                  128          !2
         12      > JMPZ                                                     ~11, ->23
   31    13    >   INIT_FCALL                                               'array_merge'
         14        SEND_VAR                                                 !1
         15        INIT_FCALL                                               'array_column'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 'percy'
         18        DO_ICALL                                         $13     
         19        SEND_VAR                                                 $13
         20        DO_ICALL                                         $14     
         21        ASSIGN_DIM                                               !1
         22        OP_DATA                                                  $14
   26    23    > > JMP                                                      ->3
         24    >   FE_FREE                                                  $6
   37    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.55 ms | 1388 KiB | 19 Q