3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ [ 'id' => '1', 'order' => '123238' ], [ 'id' => '2', 'order' => '33278' ], [ 'id' => '3', 'order' => '8892372' ] ]; $arr2 = [ [ 'id' => '1', 'order' => '349483' ], [ 'id' => '2', 'order' => '9837283' ], [ 'id' => '3', 'order' => '33278' ] ]; // values in both $arr1 and $arr2 print_r(array_uintersect($arr1, $arr2, function ($a, $b) { return $a['order'] - $b['order']; })); // values in $arr1 but not $arr2 print_r(array_udiff($arr1, $arr2, function ($a, $b) { return $a['order'] - $b['order']; })); // values in $arr2 but not $arr1 print_r(array_udiff($arr1, $arr2, function ($a, $b) { return $a['order'] - $b['order']; })); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e1BKS
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
   20     1        ASSIGN                                                   !1, <array>
   36     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'array_uintersect'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
   38    11        INIT_FCALL                                               'print_r'
         12        INIT_FCALL                                               'array_udiff'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DECLARE_LAMBDA_FUNCTION                          ~7      [1]
         16        SEND_VAL                                                 ~7
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                                 
   40    20        INIT_FCALL                                               'print_r'
         21        INIT_FCALL                                               'array_udiff'
         22        SEND_VAR                                                 !0
         23        SEND_VAR                                                 !1
         24        DECLARE_LAMBDA_FUNCTION                          ~10     [2]
         25        SEND_VAL                                                 ~10
         26        DO_ICALL                                         $11     
         27        SEND_VAR                                                 $11
         28        DO_ICALL                                                 
   42    29      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e1BKS
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_DIM_R                                      ~2      !0, 'order'
          3        FETCH_DIM_R                                      ~3      !1, 'order'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
          6*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e1BKS
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_DIM_R                                      ~2      !0, 'order'
          3        FETCH_DIM_R                                      ~3      !1, 'order'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
          6*     > RETURN                                                   null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e1BKS
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_DIM_R                                      ~2      !0, 'order'
          3        FETCH_DIM_R                                      ~3      !1, 'order'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
          6*     > RETURN                                                   null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.57 ms | 1017 KiB | 16 Q