3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayReplace($a1, $a2) { foreach($a2 as $k=>$v) { $a1[$k]=$v; } return $a1; } $a1 = array(0 => 1, 1 => "b", 3 => "carrot"); $a2 = array(1 => "c", 2 => "d", 3 => "apple"); print_r(arrayReplace($a1, $a2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NQ5RU
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a1, !1 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'arrayreplace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function arrayreplace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/NQ5RU
function name:  arrayReplace
number of ops:  11
compiled vars:  !0 = $a1, !1 = $a2, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2      > FE_RESET_R                                       $4      !1, ->8
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->8
          4    >   ASSIGN                                                   !3, ~5
    4     5        ASSIGN_DIM                                               !0, !3
          6        OP_DATA                                                  !2
    3     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $4
    6     9      > RETURN                                                   !0
    7    10*     > RETURN                                                   null

End of function arrayreplace

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.12 ms | 1398 KiB | 16 Q