3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('test' => array('percy' => array('hello' => 'hatcherson'), 'percy' => array('mitchell', 'anderson'))); $allowed = array('percy'); $combined = array(); foreach ($arr as $k => $v) { $combined[] = array_intersect_key($arr, array_flip($allowed)); } var_dump($combined);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/YkXXv
function name:  (null)
number of ops:  21
compiled vars:  !0 = $arr, !1 = $allowed, !2 = $combined, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, <array>
    8     3      > FE_RESET_R                                       $8      !0, ->16
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->16
          5    >   ASSIGN                                                   !4, ~9
   10     6        INIT_FCALL                                               'array_intersect_key'
          7        SEND_VAR                                                 !0
          8        INIT_FCALL                                               'array_flip'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $12     
         11        SEND_VAR                                                 $12
         12        DO_ICALL                                         $13     
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  $13
    8    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $8
   15    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.62 ms | 1395 KiB | 19 Q