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'), ); usort($array2,function($a,$b){ return strnatcmp($a['ur_user_id'],$b['ur_user_id']); }); $array3 = array_replace_recursive($array1, $array2); print_r(array_uintersect($array3,$array1,function($a,$b){ return strnatcmp($a['ur_user_id'],$b['ur_user_id']); }));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mhvL9
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array1, !1 = $array2, !2 = $array3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   18     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmhvL9%3A18%240'
   20     5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
   21     7        INIT_FCALL                                               'array_replace_recursive'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   22    12        INIT_FCALL                                               'print_r'
         13        INIT_FCALL                                               'array_uintersect'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !0
         16        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmhvL9%3A22%241'
   24    17        SEND_VAL                                                 ~9
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmhvL9%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mhvL9
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'strnatcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'ur_user_id'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'ur_user_id'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   20     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmhvL9%3A18%240

Function %00%7Bclosure%7D%2Fin%2FmhvL9%3A22%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mhvL9
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        INIT_FCALL                                               'strnatcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'ur_user_id'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'ur_user_id'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   24     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmhvL9%3A22%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.67 ms | 1405 KiB | 23 Q