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_column($testArray, 'percy'); var_dump($newArray); exit(); 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
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/TF7vM
function name:  (null)
number of ops:  31
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        INIT_FCALL                                               'array_column'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'percy'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   25     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   26     9      > EXIT                                                     
   27    10*       FE_RESET_R                                       $8      !0, ->26
         11*       FE_FETCH_R                                       ~9      $8, !2, ->26
         12*       ASSIGN                                                   !3, ~9
   29    13*       TYPE_CHECK                                  128          !2
         14*       JMPZ                                                     ~11, ->25
   30    15*       INIT_FCALL                                               'array_merge'
         16*       SEND_VAR                                                 !1
         17*       INIT_FCALL                                               'array_column'
         18*       SEND_VAR                                                 !2
         19*       SEND_VAL                                                 'percy'
         20*       DO_ICALL                                         $13     
         21*       SEND_VAR                                                 $13
         22*       DO_ICALL                                         $14     
         23*       ASSIGN_DIM                                               !1
         24*       OP_DATA                                                  $14
   27    25*       JMP                                                      ->11
         26*       FE_FREE                                                  $8
   36    27*       INIT_FCALL                                               'var_dump'
         28*       SEND_VAR                                                 !1
         29*       DO_ICALL                                                 
         30*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.67 ms | 1395 KiB | 19 Q