3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array( "0" => 5, "1" => 2, "4" => 67 ); $arr2 = array( "0" => 5, "1" => 2, "8" => 78 ); array_merge($arr2, array_fill_keys(array_diff($arr1, $arr2), 0)); print_r($arr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hk0A9
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !1
          4        INIT_FCALL                                               'array_fill_keys'
          5        INIT_FCALL                                               'array_diff'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        SEND_VAL                                                 0
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                                 
   17    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1394 KiB | 21 Q