3v4l.org

run code in 500+ PHP versions simultaneously
<?php $all_array = array('a'=>'1', 'b'=>'2', 'c'=>'3', 'd'=>'4', 'e'=>'5'); $find_array = array('b', 'd', 'e'); $r=[]; array_walk($find_array, function($v,$k) use($all_array,&$r){$r[] = $all_array[$v];}); print_r($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ReIIJ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $all_array, !1 = $find_array, !2 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    5     2        ASSIGN                                                       !2, <array>
    6     3        INIT_FCALL                                                   'array_walk'
          4        SEND_REF                                                     !1
          5        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          6        BIND_LEXICAL                                                 ~6, !0
          7        BIND_LEXICAL                                                 ~6, !2
          8        SEND_VAL                                                     ~6
          9        DO_ICALL                                                     
    7    10        INIT_FCALL                                                   'print_r'
         11        SEND_VAR                                                     !2
         12        DO_ICALL                                                     
         13      > 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/ReIIJ
function name:  {closure:/in/ReIIJ:6}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $all_array, !3 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
          3        BIND_STATIC                                                  !3
          4        FETCH_DIM_R                                          ~5      !2, !0
          5        ASSIGN_DIM                                                   !3
          6        OP_DATA                                                      ~5
          7      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.78 ms | 2052 KiB | 14 Q