3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr_1=array(array('name'=>'john','sex'=>'male','grade'=>'9'),array('name'=>'Smith','sex'=>'male','grade'=>'11')); $arr_2=array(array('name'=>'john','sex'=>'male','grade'=>'9'),array('name'=>'Smith','sex'=>'male','grade'=>'11'),array('name'=>'Kelly','sex'=>'female','grade'=>'10')); $c1 = array_map("customImplode",$arr_1); $c2 = array_map("customImplode",$arr_2); function customImplode($data){ return implode("|",$data); } function customExplode($data){ return explode("|",$data); } $result = array_map("customExplode",array_unique(array_merge(array_diff($c1,$c2),array_diff($c2,$c1)))); echo "<pre>"; print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULtdp
function name:  (null)
number of ops:  37
compiled vars:  !0 = $arr_1, !1 = $arr_2, !2 = $c1, !3 = $c2, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'customImplode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    7     7        INIT_FCALL                                               'array_map'
          8        SEND_VAL                                                 'customImplode'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
   17    12        INIT_FCALL                                               'array_map'
         13        SEND_VAL                                                 'customExplode'
         14        INIT_FCALL                                               'array_unique'
         15        INIT_FCALL                                               'array_merge'
         16        INIT_FCALL                                               'array_diff'
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        INIT_FCALL                                               'array_diff'
         22        SEND_VAR                                                 !3
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                         $13     
         27        SEND_VAR                                                 $13
         28        DO_ICALL                                         $14     
         29        SEND_VAR                                                 $14
         30        DO_ICALL                                         $15     
         31        ASSIGN                                                   !4, $15
   19    32        ECHO                                                     '%3Cpre%3E'
   20    33        INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !4
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Function customimplode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULtdp
function name:  customImplode
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%7C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   11     6*     > RETURN                                                   null

End of function customimplode

Function customexplode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULtdp
function name:  customExplode
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%7C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   15     6*     > RETURN                                                   null

End of function customexplode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.06 ms | 1017 KiB | 20 Q