3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_array = ['a','b','c']; $array_main[] = &$my_array; $array_main[] = [1, 2]; $array_main[] = [4, 5]; $array_main[] = ['etc', 'bla']; $iterations = count($array_main); for ($i = 1; $i < $iterations; $i++) { $array_main[0] = array_merge( $array_main[0], $array_main[$i] ); } echo '<pre>'; print_r($my_array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 13
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 13
Branch analysis from position: 24
Branch analysis from position: 13
filename:       /in/LF0CR
function name:  (null)
number of ops:  29
compiled vars:  !0 = $my_array, !1 = $array_main, !2 = $iterations, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        FETCH_DIM_W                                      $5      !1
          2        ASSIGN_REF                                               $5, !0
    6     3        ASSIGN_DIM                                               !1
          4        OP_DATA                                                  <array>
    7     5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  <array>
    8     7        ASSIGN_DIM                                               !1
          8        OP_DATA                                                  <array>
   10     9        COUNT                                            ~10     !1
         10        ASSIGN                                                   !2, ~10
   12    11        ASSIGN                                                   !3, 1
         12      > JMP                                                      ->22
   13    13    >   INIT_FCALL                                               'array_merge'
   14    14        FETCH_DIM_R                                      ~14     !1, 0
         15        SEND_VAL                                                 ~14
   15    16        FETCH_DIM_R                                      ~15     !1, !3
         17        SEND_VAL                                                 ~15
   13    18        DO_ICALL                                         $16     
         19        ASSIGN_DIM                                               !1, 0
   15    20        OP_DATA                                                  $16
   12    21        PRE_INC                                                  !3
         22    >   IS_SMALLER                                               !3, !2
         23      > JMPNZ                                                    ~18, ->13
   19    24    >   ECHO                                                     '%3Cpre%3E'
   20    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.6 ms | 1000 KiB | 15 Q