3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array("item_data"=>array(1,2,3),"type"=>a), array("item_data"=>array(4,5,6)), array("item_data"=>array(7,8,9)) ); var_dump($arr); 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 = 62) Position 1 = -2
filename:       /in/Hu0at
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arr, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~2      <array>, 'item_data'
          1        FETCH_CONSTANT                                   ~3      'a'
          2        ADD_ARRAY_ELEMENT                                ~2      ~3, 'type'
          3        INIT_ARRAY                                       ~4      ~2
          4        ADD_ARRAY_ELEMENT                                ~4      <array>
          5        ADD_ARRAY_ELEMENT                                ~4      <array>
          6        ASSIGN                                                   !0, ~4
    4     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'array_reduce'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 'merge'
         13        SEND_VAL                                                 <array>
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !1, $7
    9    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function merge:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hu0at
function name:  merge
number of ops:  9
compiled vars:  !0 = $prev, !1 = $now
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     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
    7     8*     > RETURN                                                   null

End of function merge

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.37 ms | 1396 KiB | 21 Q