3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array( array('categoryid' => '31', 'itemname' => 'Math - Quiz #1'), array('categoryid' => '33', 'itemname' => 'Math - Quiz #2'), array('categoryid' => '35', 'itemname' => 'Math - Quiz #3'), array('categoryid' => '31', 'itemname' => 'Math - Quiz #4') ); $arr2 = array('categoryid' => '31'); $intersect = array_uintersect($arr1, $arr2, 'compareDeepValue'); print_r($intersect); function compareDeepValue($val1, $val2) { return strcmp($val1['categoryid'], $val2['categoryid']); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0otZH
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $intersect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'array_uintersect'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 'compareDeepValue'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   12     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   17    11      > RETURN                                                   1

Function comparedeepvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0otZH
function name:  compareDeepValue
number of ops:  10
compiled vars:  !0 = $val1, !1 = $val2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'strcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'categoryid'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'categoryid'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   17     9*     > RETURN                                                   null

End of function comparedeepvalue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.76 ms | 1395 KiB | 19 Q