3v4l.org

run code in 300+ PHP versions simultaneously
<?php $def = array( 1 => 'on', 2 => 'on', 3 => 'on' ); $fill = array( 2 => 'off' ); $res = array_merge($fill, $def); $res2 = array_merge($def, $fill); print_r($res); print_r($res2); function array_merge_custom($first, $second) { $result = array(); foreach($first as $key => $value) { $result[$key] = $value; } foreach($second as $key => $value) { $result[$key] = $value; } return $result; } $res3 = array_merge_custom($def, $fill); print_r($res3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/INipG
function name:  (null)
number of ops:  27
compiled vars:  !0 = $def, !1 = $fill, !2 = $res, !3 = $res2, !4 = $res3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   13     2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   14     7        INIT_FCALL                                               'array_merge'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
   16    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   18    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
   32    18        INIT_FCALL                                               'array_merge_custom'
         19        SEND_VAR                                                 !0
         20        SEND_VAR                                                 !1
         21        DO_FCALL                                      0  $13     
         22        ASSIGN                                                   !4, $13
   33    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function array_merge_custom:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 9
filename:       /in/INipG
function name:  array_merge_custom
number of ops:  19
compiled vars:  !0 = $first, !1 = $second, !2 = $result, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        ASSIGN                                                   !2, <array>
   22     3      > FE_RESET_R                                       $6      !0, ->9
          4    > > FE_FETCH_R                                       ~7      $6, !3, ->9
          5    >   ASSIGN                                                   !4, ~7
   23     6        ASSIGN_DIM                                               !2, !4
          7        OP_DATA                                                  !3
   22     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $6
   25    10      > FE_RESET_R                                       $10     !1, ->16
         11    > > FE_FETCH_R                                       ~11     $10, !3, ->16
         12    >   ASSIGN                                                   !4, ~11
   26    13        ASSIGN_DIM                                               !2, !4
         14        OP_DATA                                                  !3
   25    15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $10
   29    17      > RETURN                                                   !2
   30    18*     > RETURN                                                   null

End of function array_merge_custom

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.89 ms | 1403 KiB | 18 Q