3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => [ "sales_total" => "4165.80", "staff_id" => 6, ], 1 => [ "sales_total" => "1335.60", "staff_id" => 10, ], ]; $arr1 = [ 0 => [ "id" => 6, "sales_target_amount" => "30000.00", ], 1 => [ "id" => 10, "sales_target_amount" => "1000.00", ], ]; $arr = array_column($arr, null, 'staff_id'); $temp = array_column($arr1, 'sales_target_amount', 'id'); foreach ($arr as $key => $value) { $arr[$key]['sales_target_amount'] = $temp[$key]; } print_r(array_values($arr));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/VQEnU
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr, !1 = $arr1, !2 = $temp, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   22     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 null
          5        SEND_VAL                                                 'staff_id'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !0, $7
   23     8        INIT_FCALL                                               'array_column'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'sales_target_amount'
         11        SEND_VAL                                                 'id'
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
   24    14      > FE_RESET_R                                       $11     !0, ->22
         15    > > FE_FETCH_R                                       ~12     $11, !3, ->22
         16    >   ASSIGN                                                   !4, ~12
   25    17        FETCH_DIM_R                                      ~16     !2, !4
         18        FETCH_DIM_W                                      $14     !0, !4
         19        ASSIGN_DIM                                               $14, 'sales_target_amount'
         20        OP_DATA                                                  ~16
   24    21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $11
   27    23        INIT_FCALL                                               'print_r'
         24        INIT_FCALL                                               'array_values'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $17     
         27        SEND_VAR                                                 $17
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1013 KiB | 16 Q