3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = Array ( 'arr1' => Array ( 'JAN2016', 'MAI2013', 'JUN2014', ), 'arr2' => Array ( 'APR2016', 'DEC2013', 'JUN2014', ), 'arr3' => Array ( 'JAN2016', 'MAI2020', 'JUN2022', ) ); $newArray = []; foreach($input as $k=>$values) { foreach($values as $value) { $newArray[$value][] = $k; } } print_r(array_filter($newArray, function($v) { return 1 < count($v); }));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/UcEYg
function name:  (null)
number of ops:  23
compiled vars:  !0 = $input, !1 = $newArray, !2 = $values, !3 = $k, !4 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   25     1        ASSIGN                                                   !1, <array>
   26     2      > FE_RESET_R                                       $7      !0, ->13
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->13
          4    >   ASSIGN                                                   !3, ~8
   28     5      > FE_RESET_R                                       $10     !2, ->11
          6    > > FE_FETCH_R                                               $10, !4, ->11
   30     7    >   FETCH_DIM_W                                      $11     !1, !4
          8        ASSIGN_DIM                                               $11
          9        OP_DATA                                                  !3
   28    10      > JMP                                                      ->6
         11    >   FE_FREE                                                  $10
   26    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $7
   33    14        INIT_FCALL                                               'print_r'
         15        INIT_FCALL                                               'array_filter'
         16        SEND_VAR                                                 !1
         17        DECLARE_LAMBDA_FUNCTION                          ~13     [0]
         18        SEND_VAL                                                 ~13
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                                 
         22      > 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/UcEYg
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        COUNT                                            ~1      !0
          2        IS_SMALLER                                       ~2      1, ~1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.9 ms | 1012 KiB | 15 Q