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[] = $v; } } return $merged; } $array1 = array('A' => 'Adam', 'B' => 'Bernie', 'C' => 'Chris'); $array2 = array('C' => 'Charlie', 'D' => 'David', 'E' => 'Earnslaw'); 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/Nru0L
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 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Nru0L
function name:  awesome
number of ops:  18
compiled vars:  !0 = $arrays, !1 = $array, !2 = $v, !3 = $k, !4 = $merged
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>
    6     5    > > FE_RESET_R                                       $7      !0, ->15
          6    > > FE_FETCH_R                                               $7, !1, ->15
    7     7    > > FE_RESET_R                                       $8      !1, ->13
          8    > > FE_FETCH_R                                       ~9      $8, !2, ->13
          9    >   ASSIGN                                                   !3, ~9
    8    10        ASSIGN_DIM                                               !4
         11        OP_DATA                                                  !2
    7    12      > JMP                                                      ->8
         13    >   FE_FREE                                                  $8
    6    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $7
   11    16      > RETURN                                                   !4
   12    17*     > RETURN                                                   null

End of function awesome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.13 ms | 1403 KiB | 18 Q