3v4l.org

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

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

End of function merge

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.3 ms | 1395 KiB | 19 Q