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)) ); function merge($prev, $now) { return array_merge($prev, $now['item_data']); } $res = array_reduce($arr, "merge",array()); var_dump($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0AfO1
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'merge'
          4        SEND_VAL                                                 <array>
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    9     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function merge:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0AfO1
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:
204.32 ms | 1386 KiB | 19 Q