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){ return array_merge($prev,$now['class'][0]); } $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/tWPV3
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                                                 
    8     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
    9    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/tWPV3
function name:  merge
number of ops:  10
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, 'class'
          5        FETCH_DIM_R                                      ~3      ~2, 0
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
    7     9*     > RETURN                                                   null

End of function merge

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.86 ms | 1387 KiB | 19 Q