3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array("item_data"=>array(1,2,3)), array("item_data"=>array(4,5,6)), array("item_data"=>array(7,8,9)) ); var_dump($arr);die; function merge($prev, $now) { return array_merge($prev, $now['item_data']); } $res = array_reduce($arr, "merge", array()); print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/rtHX4
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > EXIT                                                     
    9     5*       INIT_FCALL                                               'array_reduce'
          6*       SEND_VAR                                                 !0
          7*       SEND_VAL                                                 'merge'
          8*       SEND_VAL                                                 <array>
          9*       DO_ICALL                                         $4      
         10*       ASSIGN                                                   !1, $4
   10    11*       INIT_FCALL                                               'print_r'
         12*       SEND_VAR                                                 !1
         13*       DO_ICALL                                                 
         14*     > RETURN                                                   1

Function merge:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rtHX4
function name:  merge
number of ops:  9
compiled vars:  !0 = $prev, !1 = $now
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !0
          4        FETCH_DIM_R                                      ~2      !1, 'item_data'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
    8     8*     > RETURN                                                   null

End of function merge

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.38 ms | 1395 KiB | 21 Q