3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [1, 30, 33], ['id' => 5] ]; $result = array_reduce($array, function (array $result, array $array) { return array_merge($result, array_map(function ($id) { return compact('id'); }, array_values($array))); }, []); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mK0I
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8mK0I%3A8%240'
   10     4        SEND_VAL                                                 ~3
          5        SEND_VAL                                                 <array>
          6        DO_ICALL                                         $4      
    8     7        ASSIGN                                                   !1, $4
   12     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F8mK0I%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mK0I
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $result, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_map'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8mK0I%3A9%241'
          6        SEND_VAL                                                 ~2
          7        INIT_FCALL                                               'array_values'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                         $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                         $5      
         14      > RETURN                                                   $5
   10    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8mK0I%3A8%240

Function %00%7Bclosure%7D%2Fin%2F8mK0I%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mK0I
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'compact'
          2        SEND_VAL                                                 'id'
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8mK0I%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.78 ms | 1392 KiB | 25 Q