3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array1 = [ [10, 'Some Name..'], [11, 'Some Name..'], [13, 'Some Name..'], ]; $array2 = [ [13, 'Viewed'] ]; var_export( array_reduce( array_merge($array1, $array2), function($result, $row) { if (!isset($result[$row[0]])) { $result[$row[0]] = $row; } else { $result[$row[0]][] = $row[1]; } return $result; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aBTJU
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   13     2        INIT_FCALL                                                   'var_export'
   14     3        INIT_FCALL                                                   'array_reduce'
   15     4        INIT_FCALL                                                   'array_merge'
          5        SEND_VAR                                                     !0
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                             $4      
          8        SEND_VAR                                                     $4
   16     9        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
   23    10        SEND_VAL                                                     ~5
   14    11        DO_ICALL                                             $6      
   23    12        SEND_VAR                                                     $6
   13    13        DO_ICALL                                                     
   25    14      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aBTJU
function name:  {closure:/in/aBTJU:16}
number of ops:  17
compiled vars:  !0 = $result, !1 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   17     2        FETCH_DIM_R                                          ~2      !1, 0
          3        ISSET_ISEMPTY_DIM_OBJ                             0  ~3      !0, ~2
          4        BOOL_NOT                                             ~4      ~3
          5      > JMPZ                                                         ~4, ->10
   18     6    >   FETCH_DIM_R                                          ~5      !1, 0
          7        ASSIGN_DIM                                                   !0, ~5
          8        OP_DATA                                                      !1
   17     9      > JMP                                                          ->15
   20    10    >   FETCH_DIM_R                                          ~7      !1, 0
         11        FETCH_DIM_R                                          ~10     !1, 1
         12        FETCH_DIM_W                                          $8      !0, ~7
         13        ASSIGN_DIM                                                   $8
         14        OP_DATA                                                      ~10
   22    15    > > RETURN                                                       !0
   23    16*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.16 ms | 2046 KiB | 16 Q