3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a[] = ["ID" => 101, "CODE" => 1]; $a[] = ["ID" => 105, "CODE" => 2]; $b[] = ["ID" => 105, "Amount" => 200]; $b[] = ["ID" => 101, "Amount" => 100]; $a = array_column($a, null, "ID"); $b = array_column($b, null, "ID"); ksort($a); ksort($b); $res = array_map('array_merge', $a, $b); print_r(array_values($res));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CLV3I
function name:  (null)
number of ops:  39
compiled vars:  !0 = $a, !1 = $b, !2 = $res
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN_DIM                                                   !0
          1        OP_DATA                                                      <array>
    5     2        ASSIGN_DIM                                                   !0
          3        OP_DATA                                                      <array>
    7     4        ASSIGN_DIM                                                   !1
          5        OP_DATA                                                      <array>
    8     6        ASSIGN_DIM                                                   !1
          7        OP_DATA                                                      <array>
   12     8        INIT_FCALL                                                   'array_column'
          9        SEND_VAR                                                     !0
         10        SEND_VAL                                                     null
         11        SEND_VAL                                                     'ID'
         12        DO_ICALL                                             $7      
         13        ASSIGN                                                       !0, $7
   13    14        INIT_FCALL                                                   'array_column'
         15        SEND_VAR                                                     !1
         16        SEND_VAL                                                     null
         17        SEND_VAL                                                     'ID'
         18        DO_ICALL                                             $9      
         19        ASSIGN                                                       !1, $9
   15    20        INIT_FCALL                                                   'ksort'
         21        SEND_REF                                                     !0
         22        DO_ICALL                                                     
   16    23        INIT_FCALL                                                   'ksort'
         24        SEND_REF                                                     !1
         25        DO_ICALL                                                     
   18    26        INIT_FCALL                                                   'array_map'
         27        SEND_VAL                                                     'array_merge'
         28        SEND_VAR                                                     !0
         29        SEND_VAR                                                     !1
         30        DO_ICALL                                             $13     
         31        ASSIGN                                                       !2, $13
   21    32        INIT_FCALL                                                   'print_r'
         33        INIT_FCALL                                                   'array_values'
         34        SEND_VAR                                                     !2
         35        DO_ICALL                                             $15     
         36        SEND_VAR                                                     $15
         37        DO_ICALL                                                     
         38      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.81 ms | 2432 KiB | 18 Q