3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = $r = $m = []; $a[1] = ['1','2','3']; $a[2] = ['4','5','6']; foreach ($a as $p) { $r = array_merge($r, $p); } var_dump($r); var_dump(array_map('array_merge', $a, [$r]));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/1cG5s
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $r, !2 = $m, !3 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                           ~4      !2, <array>
          1        ASSIGN                                           ~5      !1, ~4
          2        ASSIGN                                                   !0, ~5
    3     3        ASSIGN_DIM                                               !0, 1
          4        OP_DATA                                                  <array>
    4     5        ASSIGN_DIM                                               !0, 2
          6        OP_DATA                                                  <array>
    5     7      > FE_RESET_R                                       $9      !0, ->15
          8    > > FE_FETCH_R                                               $9, !3, ->15
    6     9    >   INIT_FCALL                                               'array_merge'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !1, $10
    5    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $9
    8    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
    9    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'array_map'
         21        SEND_VAL                                                 'array_merge'
         22        SEND_VAR                                                 !0
         23        INIT_ARRAY                                       ~13     !1
         24        SEND_VAL                                                 ~13
         25        DO_ICALL                                         $14     
         26        SEND_VAR                                                 $14
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.68 ms | 1401 KiB | 19 Q