3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ 'item-1' => [ 'item-child-1', 'item-child-2' ], 'item-2' => [ 'item-child-1', 'item-child-2' , 'item-child-3'], 'item-3' => [ 'item-child-1' ] ]; $out = array_map(function ($arr) {return end($arr);}, $array); print_r($out);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Zl0l
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $out
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    8     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          3        SEND_VAL                                                     ~3
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $4      
          6        ASSIGN                                                       !1, $4
   10     7        INIT_FCALL                                                   'print_r'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                                     
         10      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Zl0l
function name:  {closure:/in/2Zl0l:8}
number of ops:  6
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'end'
          2        SEND_REF                                                     !0
          3        DO_ICALL                                             $1      
          4      > RETURN                                                       $1
          5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.36 ms | 2073 KiB | 16 Q