3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = [array ( 77 => Array ( 'Bold Condensed', 'Bold Condensed 2', 'Bold Condensed 3' ) ), array ( 77 => array ( 'Bold Condensed' ), 136 => array ( 'Regular' ) ), array ( 77 => array ( 'Bold Condensed (1, 2, 3)' ), 168 => array ( 'Regular', 'Bold' ) )]; $result = []; foreach($d as $subs){ foreach($subs as $id => $values){ $result[ $id ] = array_merge($result[ $id ] ?? [], $values); } } $result = array_map(fn($v) => array_unique($v), $result); print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/HrXSA
function name:  (null)
number of ops:  30
compiled vars:  !0 = $d, !1 = $result, !2 = $subs, !3 = $values, !4 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   36     1        ASSIGN                                                   !1, <array>
   38     2      > FE_RESET_R                                       $7      !0, ->19
          3    > > FE_FETCH_R                                               $7, !2, ->19
   39     4    > > FE_RESET_R                                       $8      !2, ->17
          5    > > FE_FETCH_R                                       ~9      $8, !3, ->17
          6    >   ASSIGN                                                   !4, ~9
   40     7        INIT_FCALL                                               'array_merge'
          8        FETCH_DIM_IS                                     ~12     !1, !4
          9        COALESCE                                         ~13     ~12
         10        QM_ASSIGN                                        ~13     <array>
         11        SEND_VAL                                                 ~13
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $14     
         14        ASSIGN_DIM                                               !1, !4
         15        OP_DATA                                                  $14
   39    16      > JMP                                                      ->5
         17    >   FE_FREE                                                  $8
   38    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $7
   44    20        INIT_FCALL                                               'array_map'
         21        DECLARE_LAMBDA_FUNCTION                          ~15     [0]
         22        SEND_VAL                                                 ~15
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !1, $16
   46    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
         29      > 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/HrXSA
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_unique'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1021 KiB | 17 Q