3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 0 => ['ax' => 'Aland Islands'], 1 => ['as' => 'American Samoa'], 2 => ['am' => 'Armenia'] ]; $newArr = array_merge($arr[0], $arr[1], $arr[2]); print_r($newArr); $newArr2 = array_merge(...$arr); print_r($newArr2); foreach ($arr as $item){ $key = array_keys($item)[0]; @$newArr3[$key] = $item[$key]; } print_r($newArr3);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 34
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/13A9I
function name:  (null)
number of ops:  39
compiled vars:  !0 = $arr, !1 = $newArr, !2 = $newArr2, !3 = $item, !4 = $key, !5 = $newArr3
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    8     1        INIT_FCALL                                                   'array_merge'
          2        FETCH_DIM_R                                          ~7      !0, 0
          3        SEND_VAL                                                     ~7
          4        FETCH_DIM_R                                          ~8      !0, 1
          5        SEND_VAL                                                     ~8
          6        FETCH_DIM_R                                          ~9      !0, 2
          7        SEND_VAL                                                     ~9
          8        DO_ICALL                                             $10     
          9        ASSIGN                                                       !1, $10
    9    10        INIT_FCALL                                                   'print_r'
         11        SEND_VAR                                                     !1
         12        DO_ICALL                                                     
   11    13        INIT_FCALL                                                   'array_merge'
         14        SEND_UNPACK                                                  !0
         15        CHECK_UNDEF_ARGS                                             
         16        DO_ICALL                                             $13     
         17        ASSIGN                                                       !2, $13
   12    18        INIT_FCALL                                                   'print_r'
         19        SEND_VAR                                                     !2
         20        DO_ICALL                                                     
   14    21      > FE_RESET_R                                           $16     !0, ->34
         22    > > FE_FETCH_R                                                   $16, !3, ->34
   15    23    >   INIT_FCALL                                                   'array_keys'
         24        SEND_VAR                                                     !3
         25        DO_ICALL                                             $17     
         26        FETCH_DIM_R                                          ~18     $17, 0
         27        ASSIGN                                                       !4, ~18
   16    28        BEGIN_SILENCE                                        ~20     
         29        FETCH_DIM_R                                          ~22     !3, !4
         30        ASSIGN_DIM                                                   !5, !4
         31        OP_DATA                                                      ~22
         32        END_SILENCE                                                  ~20
   14    33      > JMP                                                          ->22
         34    >   FE_FREE                                                      $16
   18    35        INIT_FCALL                                                   'print_r'
         36        SEND_VAR                                                     !5
         37        DO_ICALL                                                     
         38      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.15 ms | 2173 KiB | 16 Q