3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array( array('ur_user_id'=> 1,'ur_fname'=>'PerA','ur_lname'=>'SonA'), array('ur_user_id'=> 2,'ur_fname'=>'PerB','ur_lname'=>'SonB'), array('ur_user_id'=> 3,'ur_fname'=>'PerC','ur_lname'=>'SonC'), ); $array2 = array( array('ur_user_id' => 5,'ur_code' => 'EE','ur_user_role' => 'testE'), array('ur_user_id' => 4,'ur_code' => 'DD','ur_user_role' => 'testD'), array('ur_user_id' => 6,'ur_code' => 'FF','ur_user_role' => 'testF'), array('ur_user_id' => 3,'ur_code' => 'CC','ur_user_role' => 'testC'), array('ur_user_id' => 1,'ur_code' => 'AA','ur_user_role' => 'testA'), array('ur_user_id' => 2,'ur_code' => 'BB','ur_user_role' => 'testB'), ); $keyed = array_column($array2, NULL, 'ur_user_id'); foreach ($array1 as &$row) { if (isset($keyed[$row['ur_user_id']])) { $row += $keyed[$row['ur_user_id']]; } } var_export($array1);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 126) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/8hl1u
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array1, !1 = $array2, !2 = $keyed, !3 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   18     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 null
          5        SEND_VAL                                                 'ur_user_id'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
   20     8      > FE_RESET_RW                                      $8      !0, ->17
          9    > > FE_FETCH_RW                                              $8, !3, ->17
   21    10    >   FETCH_DIM_R                                      ~9      !3, 'ur_user_id'
         11        ISSET_ISEMPTY_DIM_OBJ                         0          !2, ~9
         12      > JMPZ                                                     ~10, ->16
   22    13    >   FETCH_DIM_R                                      ~11     !3, 'ur_user_id'
         14        FETCH_DIM_R                                      ~12     !2, ~11
         15        ASSIGN_OP                                     1          !3, ~12
   20    16    > > JMP                                                      ->9
         17    >   FE_FREE                                                  $8
   26    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.18 ms | 1001 KiB | 15 Q