3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ["item_id" => "1", "item_name" => "a"], ["item_id" => "2", "item_name" => "b"], ["item_id" => "3", "item_name" => "c"], ["item_id" => "4", "item_name" => "d"], ["item_id" => "5", "item_name" => "e"], ["item_id" => "6", "item_name" => "f"] ]; $val = [10, 11, 12]; $bump = count($array) - count($val); foreach ($val as $i => $number) { $array[$i + $bump]['value'] = $number; } var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/du1Nq
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $val, !2 = $bump, !3 = $number, !4 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        ASSIGN                                                       !1, <array>
   14     2        COUNT                                                ~7      !0
          3        COUNT                                                ~8      !1
          4        SUB                                                  ~9      ~7, ~8
          5        ASSIGN                                                       !2, ~9
   15     6      > FE_RESET_R                                           $11     !1, ->14
          7    > > FE_FETCH_R                                           ~12     $11, !3, ->14
          8    >   ASSIGN                                                       !4, ~12
   16     9        ADD                                                  ~14     !4, !2
         10        FETCH_DIM_W                                          $15     !0, ~14
         11        ASSIGN_DIM                                                   $15, 'value'
         12        OP_DATA                                                      !3
   15    13      > JMP                                                          ->7
         14    >   FE_FREE                                                      $11
   18    15        INIT_FCALL                                                   'var_export'
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
1571.8 ms | 2096 KiB | 14 Q