3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ ['sight_id' => 13, 'location' => 'Jodhpur, Rajasthan, India'], ['sight_id' => 14, 'location' => 'Jodhpur Jn, Jodhpur, Rajasthan, India'], ['sight_id' => 15, 'location' => 'D-Kirtinagar, Jodhpur, Rajasthan, India'], ]; $array2 = [ ['sight_id' => 13, 'location' => 'Jodhpur, Rajasthan, India'], ['sight_id' => 14, 'location' => 'Jodhpur Jn, Jodhpur, Rajasthan, India'], ['sight_id' => 16, 'location' => 'Jaisalmer, Rajasthan, India'], ['sight_id' => 17, 'location' => 'Fort Road, Amar Sagar Pol, Jaisalmer, Rajasthan, India'], ]; function rowCompare($a, $b) { return $a <=> $b; } echo "Intersection:\n"; var_export( array_uintersect($array1, $array2, 'rowCompare') ); echo "\nUnique in first:\n"; var_export( array_udiff($array1, $array2, 'rowCompare') ); echo "\nUnique in second:\n"; var_export( array_udiff($array2, $array1, 'rowCompare') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s4a39
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   21     2        ECHO                                                     'Intersection%3A%0A'
   22     3        INIT_FCALL                                               'var_export'
   23     4        INIT_FCALL                                               'array_uintersect'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 'rowCompare'
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
   22    10        DO_ICALL                                                 
   26    11        ECHO                                                     '%0AUnique+in+first%3A%0A'
   27    12        INIT_FCALL                                               'var_export'
   28    13        INIT_FCALL                                               'array_udiff'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 'rowCompare'
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
   27    19        DO_ICALL                                                 
   31    20        ECHO                                                     '%0AUnique+in+second%3A%0A'
   32    21        INIT_FCALL                                               'var_export'
   33    22        INIT_FCALL                                               'array_udiff'
         23        SEND_VAR                                                 !1
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 'rowCompare'
         26        DO_ICALL                                         $8      
         27        SEND_VAR                                                 $8
   32    28        DO_ICALL                                                 
   34    29      > RETURN                                                   1

Function rowcompare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s4a39
function name:  rowCompare
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        SPACESHIP                                        ~2      !0, !1
          3      > RETURN                                                   ~2
   19     4*     > RETURN                                                   null

End of function rowcompare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.14 ms | 1013 KiB | 16 Q