3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr1 = [ ['month' => 1], ['month' => 2], ['month' => 3], ['month' => 4] ]; $arr2 = [ ['month' => 3, 'info' => 'Alpha'], ['month' => 4, 'info' => 'Beta'], ['month' => 1, 'info' => 'Gamma'], ]; $arr1 = array_column($arr1, null, 'month'); $arr2 = array_column($arr2, null, 'month'); $result = array_replace($arr1, $arr2); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tpshB
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, <array>
   16     2        INIT_FCALL                                                   'array_column'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     null
          5        SEND_VAL                                                     'month'
          6        DO_ICALL                                             $5      
          7        ASSIGN                                                       !0, $5
   17     8        INIT_FCALL                                                   'array_column'
          9        SEND_VAR                                                     !1
         10        SEND_VAL                                                     null
         11        SEND_VAL                                                     'month'
         12        DO_ICALL                                             $7      
         13        ASSIGN                                                       !1, $7
   19    14        INIT_FCALL                                                   'array_replace'
         15        SEND_VAR                                                     !0
         16        SEND_VAR                                                     !1
         17        DO_ICALL                                             $9      
         18        ASSIGN                                                       !2, $9
   20    19        INIT_FCALL                                                   'var_dump'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
176.64 ms | 3230 KiB | 16 Q