3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1= array('a' => "XL"); $arr2= array('a' => "XLd",'b'=>"CDW"); array_walk( $arr2, function(&$val,$key) use ($arr1){ if(isset($arr1[$key])){ $val = $arr1[$key]; } else { $val = ''; } } ); print_r($arr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B7G5p
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_walk'
    7     3        SEND_REF                                                 !1
    8     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !0
   14     6        SEND_VAL                                                 ~4
    6     7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B7G5p
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $val, !1 = $key, !2 = $arr1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    9     3        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !1
          4      > JMPZ                                                     ~3, ->8
   10     5    >   FETCH_DIM_R                                      ~4      !2, !1
          6        ASSIGN                                                   !0, ~4
    9     7      > JMP                                                      ->9
   12     8    >   ASSIGN                                                   !0, ''
   14     9    > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.67 ms | 1001 KiB | 15 Q