3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all_array = array('a'=>'1', 'b'=>'2', 'c'=>'3', 'd'=>'4', 'e'=>'5'); $find_array = array('b', 'd', 'e'); $new = array(); foreach($find_array as $val){ if(isset($all_array[$val])) $new[$val] = $all_array[$val]; } print_r($new);
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
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/jppbg
function name:  (null)
number of ops:  16
compiled vars:  !0 = $all_array, !1 = $find_array, !2 = $new, !3 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3      > FE_RESET_R                                       $7      !1, ->11
          4    > > FE_FETCH_R                                               $7, !3, ->11
    8     5    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, !3
          6      > JMPZ                                                     ~8, ->10
    9     7    >   FETCH_DIM_R                                      ~10     !0, !3
          8        ASSIGN_DIM                                               !2, !3
          9        OP_DATA                                                  ~10
    7    10    > > JMP                                                      ->4
         11    >   FE_FREE                                                  $7
   11    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
258.96 ms | 1004 KiB | 14 Q