3v4l.org

run code in 300+ PHP versions simultaneously
<?php function awesome(...$arrays) { if (!is_array($arrays)) return false; $merged = array_shift($arrays); foreach($arrays as $array) { foreach($array as $k => $v) { $merged[(string)$k] = $v; } } return $merged; } $array1 = array('A', 'B', 'C'); $array2 = array('B', 'C', 'D'); print_r($array1 + $array2); print_r(array_merge($array1, $array2)); print_r(awesome($array1, $array2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPnPA
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2        INIT_FCALL                                               'print_r'
          3        ADD                                              ~4      !0, !1
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                                 
   17     6        INIT_FCALL                                               'print_r'
          7        INIT_FCALL                                               'array_merge'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
   18    13        INIT_FCALL                                               'print_r'
         14        INIT_FCALL                                               'awesome'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        DO_FCALL                                      0  $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function awesome:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/HPnPA
function name:  awesome
number of ops:  23
compiled vars:  !0 = $arrays, !1 = $merged, !2 = $array, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                    !0      
    4     1        TYPE_CHECK                                  128  ~5      !0
          2        BOOL_NOT                                         ~6      ~5
          3      > JMPZ                                                     ~6, ->5
          4    > > RETURN                                                   <false>
    5     5    >   INIT_FCALL                                               'array_shift'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !1, $7
    6     9      > FE_RESET_R                                       $9      !0, ->20
         10    > > FE_FETCH_R                                               $9, !2, ->20
    7    11    > > FE_RESET_R                                       $10     !2, ->18
         12    > > FE_FETCH_R                                       ~11     $10, !3, ->18
         13    >   ASSIGN                                                   !4, ~11
    8    14        CAST                                          6  ~13     !4
         15        ASSIGN_DIM                                               !1, ~13
         16        OP_DATA                                                  !3
    7    17      > JMP                                                      ->12
         18    >   FE_FREE                                                  $10
    6    19      > JMP                                                      ->10
         20    >   FE_FREE                                                  $9
   11    21      > RETURN                                                   !1
   12    22*     > RETURN                                                   null

End of function awesome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.45 ms | 1403 KiB | 20 Q