3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = Array ( 0 => Array ( 'entry_id' => 1, 'ic' => 2147483647, 'name' => 'Kořínková Blanka', 'residency' => 'Štětí, Lukešova 354, 411 08', 'file_no' => 'KSUL 77 INS 18898 / 2013', 'detail' => '749371da-725c-4738-8def-2f7167142a6f' ), 1 => Array ( 'entry_id' => 1, 'ic' => 2147483647, 'name' => 'Kořínková Blanka', 'residency' => 'Štětí, Lukešova 354, 411 08', 'file_no' => 'KSUL 77 INS 21218 / 2013', 'detail' => '43b6a718-4647-451d-9c53-50dfee8403ff' ), 2 => Array ( 'entry_id' => 2, 'ic' => 46900217, 'name' => 'ENTEC a.s. "v likvidaci"', 'residency' => 'Staré Město, Brněnská 1916, 686 03', 'file_no' => 'KSBR 28 INS 1232 / 2013', 'detail' => 'e2155a52-c464-4357-b71b-4f4ff75585eb' ) ); $mergeId = 'entry_id'; $data = array_reduce($data, function($c, $x) use ($mergeId) { $c[$x[$mergeId]] = isset($c[$x[$mergeId]]) ?array_combine( $z=array_keys($c[$x[$mergeId]]), array_map(function($y) use ($x, $c, $mergeId) { return in_array($x[$y], (array)$c[$x[$mergeId]][$y]) ?$c[$x[$mergeId]][$y] :array_merge((array)$c[$x[$mergeId]][$y], [$x[$y]]); }, $z) ) :$x; return $c; }, []); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uQCs
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data, !1 = $mergeId
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   37     1        ASSIGN                                                       !1, 'entry_id'
   39     2        INIT_FCALL                                                   'array_reduce'
          3        SEND_VAR                                                     !0
          4        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          5        BIND_LEXICAL                                                 ~4, !1
   53     6        SEND_VAL                                                     ~4
          7        SEND_VAL                                                     <array>
   39     8        DO_ICALL                                             $5      
          9        ASSIGN                                                       !0, $5
   56    10        INIT_FCALL                                                   'var_dump'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                                     
         13      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uQCs
function name:  {closure:/in/4uQCs:39}
number of ops:  32
compiled vars:  !0 = $c, !1 = $x, !2 = $mergeId, !3 = $z
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   39     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   41     3        FETCH_DIM_R                                          ~4      !1, !2
          4        FETCH_DIM_R                                          ~6      !1, !2
          5        ISSET_ISEMPTY_DIM_OBJ                             0          !0, ~6
          6      > JMPZ                                                         ~7, ->27
   42     7    >   INIT_FCALL                                                   'array_combine'
   43     8        INIT_FCALL                                                   'array_keys'
          9        FETCH_DIM_R                                          ~8      !1, !2
         10        FETCH_DIM_R                                          ~9      !0, ~8
         11        SEND_VAL                                                     ~9
         12        DO_ICALL                                             $10     
         13        ASSIGN                                               ~11     !3, $10
         14        SEND_VAL                                                     ~11
   44    15        INIT_FCALL                                                   'array_map'
         16        DECLARE_LAMBDA_FUNCTION                              ~12     [0]
         17        BIND_LEXICAL                                                 ~12, !1
         18        BIND_LEXICAL                                                 ~12, !0
         19        BIND_LEXICAL                                                 ~12, !2
   49    20        SEND_VAL                                                     ~12
         21        SEND_VAR                                                     !3
   44    22        DO_ICALL                                             $13     
   49    23        SEND_VAR                                                     $13
   42    24        DO_ICALL                                             $14     
   49    25        QM_ASSIGN                                            ~15     $14
         26      > JMP                                                          ->28
   51    27    >   QM_ASSIGN                                            ~15     !1
   41    28    >   ASSIGN_DIM                                                   !0, ~4
   51    29        OP_DATA                                                      ~15
   52    30      > RETURN                                                       !0
   53    31*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uQCs
function name:  {closure:{closure:/in/4uQCs:39}:44}
number of ops:  29
compiled vars:  !0 = $y, !1 = $x, !2 = $c, !3 = $mergeId
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   44     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        BIND_STATIC                                                  !2
          3        BIND_STATIC                                                  !3
   46     4        FETCH_DIM_R                                          ~4      !1, !0
          5        FETCH_DIM_R                                          ~5      !1, !3
          6        FETCH_DIM_R                                          ~6      !2, ~5
          7        FETCH_DIM_R                                          ~7      ~6, !0
          8        CAST                                              7  ~8      ~7
          9        FRAMELESS_ICALL_2                in_array            ~9      ~4, ~8
         10      > JMPZ                                                         ~9, ->16
   47    11    >   FETCH_DIM_R                                          ~10     !1, !3
         12        FETCH_DIM_R                                          ~11     !2, ~10
         13        FETCH_DIM_R                                          ~12     ~11, !0
         14        QM_ASSIGN                                            ~13     ~12
         15      > JMP                                                          ->27
   48    16    >   INIT_FCALL                                                   'array_merge'
         17        FETCH_DIM_R                                          ~14     !1, !3
         18        FETCH_DIM_R                                          ~15     !2, ~14
         19        FETCH_DIM_R                                          ~16     ~15, !0
         20        CAST                                              7  ~17     ~16
         21        SEND_VAL                                                     ~17
         22        FETCH_DIM_R                                          ~18     !1, !0
         23        INIT_ARRAY                                           ~19     ~18
         24        SEND_VAL                                                     ~19
         25        DO_ICALL                                             $20     
         26        QM_ASSIGN                                            ~13     $20
         27    > > RETURN                                                       ~13
   49    28*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
483.63 ms | 3457 KiB | 20 Q