3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array =[]; $array['info']['user']['name'] = 'Jack'; $array['info']['user']['age'] = '15'; $foo = ['location' => 'bar', 'something' => 'foo', 'bar' => 'some']; array_merge($array['info'], $foo); print_r($array); //expected result /* [info] => [ 'location' => 'bar', 'something' => 'foo', ' 'bar' => 'some' 'user' => [ 'name' => Jack 'age' => 15 ] ] */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JPZ65
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_W                                      $3      !0, 'info'
          2        FETCH_DIM_W                                      $4      $3, 'user'
          3        ASSIGN_DIM                                               $4, 'name'
          4        OP_DATA                                                  'Jack'
    5     5        FETCH_DIM_W                                      $6      !0, 'info'
          6        FETCH_DIM_W                                      $7      $6, 'user'
          7        ASSIGN_DIM                                               $7, 'age'
          8        OP_DATA                                                  '15'
    7     9        ASSIGN                                                   !1, <array>
    9    10        INIT_FCALL                                               'array_merge'
         11        FETCH_DIM_R                                      ~10     !0, 'info'
         12        SEND_VAL                                                 ~10
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   11    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   25    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.63 ms | 1398 KiB | 17 Q