3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr =[['c' => 3], ['a' => 1, 'b' => 2, 'c' => 3], ['c' => 3]]; $new = $arr[0]; foreach($arr as $sub){ $new = array_intersect_key($new, $sub); } foreach($arr as &$sub){ $sub =array_intersect_key($sub, $new); } Var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
2 jumps found. (Code = 125) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
2 jumps found. (Code = 126) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 11
filename:       /in/oM3M1l
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $new, !2 = $sub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        FETCH_DIM_R                                      ~4      !0, 0
          2        ASSIGN                                                   !1, ~4
    9     3      > FE_RESET_R                                       $6      !0, ->11
          4    > > FE_FETCH_R                                               $6, !2, ->11
   10     5    >   INIT_FCALL                                               'array_intersect_key'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !1, $7
    9    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $6
   12    12      > FE_RESET_RW                                      $9      !0, ->20
         13    > > FE_FETCH_RW                                              $9, !2, ->20
   13    14    >   INIT_FCALL                                               'array_intersect_key'
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !2, $10
   12    19      > JMP                                                      ->13
         20    >   FE_FREE                                                  $9
   15    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.12 ms | 1012 KiB | 15 Q