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; } $m = awesome(array('A', 'B'), array('B', 'C')); print_r($m);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fcDlm
function name:  (null)
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'awesome'
          1        SEND_VAL                                                 <array>
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   15     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > 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/fcDlm
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:
157.97 ms | 1403 KiB | 18 Q