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'], ]; echo "Intersection:\n"; var_export( array_uintersect($array1, $array2, fn($a, $b) => $a <=> $b) ); echo "\nUnique in first:\n"; var_export( array_udiff($array1, $array2, fn($a, $b) => $a <=> $b) ); echo "\nUnique in second:\n"; var_export( array_udiff($array2, $array1, fn($a, $b) => $a <=> $b) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ndqs1
function name:  (null)
number of ops:  33
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>
   16     2        ECHO                                                     'Intersection%3A%0A'
   17     3        INIT_FCALL                                               'var_export'
   18     4        INIT_FCALL                                               'array_uintersect'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
   17    11        DO_ICALL                                                 
   21    12        ECHO                                                     '%0AUnique+in+first%3A%0A'
   22    13        INIT_FCALL                                               'var_export'
   23    14        INIT_FCALL                                               'array_udiff'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        DECLARE_LAMBDA_FUNCTION                          ~7      [1]
         18        SEND_VAL                                                 ~7
         19        DO_ICALL                                         $8      
         20        SEND_VAR                                                 $8
   22    21        DO_ICALL                                                 
   26    22        ECHO                                                     '%0AUnique+in+second%3A%0A'
   27    23        INIT_FCALL                                               'var_export'
   28    24        INIT_FCALL                                               'array_udiff'
         25        SEND_VAR                                                 !1
         26        SEND_VAR                                                 !0
         27        DECLARE_LAMBDA_FUNCTION                          ~10     [2]
         28        SEND_VAL                                                 ~10
         29        DO_ICALL                                         $11     
         30        SEND_VAR                                                 $11
   27    31        DO_ICALL                                                 
   29    32      > 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/Ndqs1
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        SPACESHIP                                        ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > 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/Ndqs1
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        SPACESHIP                                        ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > 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/Ndqs1
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        SPACESHIP                                        ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.94 ms | 1017 KiB | 16 Q