3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstarray = array ( Array ( 'id' => 863, 'flag' => 2, 'qty' => 2, 'size' => 8 ), Array ( 'id' => 861, 'flag' => 2, 'qty' => 2, 'size' => 8 ) ); $twoarray = array ( '863' => "Bead Headed Prince Nymphs size 18", '861' => "Bead Headed Prince Nymphs size 14" ); // Make firstarray associative $firstarray = array_column($firstarray, NULL,"id"); Foreach($twoarray as $key => $val){ $firstarray[$key]['name'] = $val; } Var_dump($firstarray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Is3EC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $firstarray, !1 = $twoarray, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        ASSIGN                                                   !1, <array>
   30     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 null
          5        SEND_VAL                                                 'id'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !0, $6
   32     8      > FE_RESET_R                                       $8      !1, ->15
          9    > > FE_FETCH_R                                       ~9      $8, !2, ->15
         10    >   ASSIGN                                                   !3, ~9
   33    11        FETCH_DIM_W                                      $11     !0, !3
         12        ASSIGN_DIM                                               $11, 'name'
         13        OP_DATA                                                  !2
   32    14      > JMP                                                      ->9
         15    >   FE_FREE                                                  $8
   35    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.32 ms | 998 KiB | 15 Q