3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array1 = array( array('ITEM' => 1), array('ITEM' => 2), array('ITEM' => 3), ); $array2 = array( array('ITEM' => 2), array('ITEM' => 3), array('ITEM' => 1), array('ITEM' => 4), ); // PHP7.4+ (arrow functions) var_export( array_udiff($array2, $array1, fn($a, $b) => $a['ITEM'] <=> $b['ITEM']) ); echo "\n"; // PHP7+ (spaceship operator) var_export( array_udiff($array2, $array1, function($a, $b) { return $a['ITEM'] <=> $b['ITEM']; }) ); echo "\n"; // PHP5.3+ (anonymous functions) var_export( array_udiff($array2, $array1, function($a, $b) { return $a['ITEM'] === $b['ITEM'] ? 0 : ($a['ITEM'] > $b['ITEM'] ? 1 : -1); }) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F6jo5
function name:  (null)
number of ops:  32
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>
   17     2        INIT_FCALL                                                   'var_export'
   18     3        INIT_FCALL                                                   'array_udiff'
          4        SEND_VAR                                                     !1
          5        SEND_VAR                                                     !0
          6        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          7        SEND_VAL                                                     ~4
          8        DO_ICALL                                             $5      
          9        SEND_VAR                                                     $5
   17    10        DO_ICALL                                                     
   20    11        ECHO                                                         '%0A'
   23    12        INIT_FCALL                                                   'var_export'
   24    13        INIT_FCALL                                                   'array_udiff'
         14        SEND_VAR                                                     !1
         15        SEND_VAR                                                     !0
         16        DECLARE_LAMBDA_FUNCTION                              ~7      [1]
         17        SEND_VAL                                                     ~7
         18        DO_ICALL                                             $8      
         19        SEND_VAR                                                     $8
   23    20        DO_ICALL                                                     
   26    21        ECHO                                                         '%0A'
   29    22        INIT_FCALL                                                   'var_export'
   30    23        INIT_FCALL                                                   'array_udiff'
         24        SEND_VAR                                                     !1
         25        SEND_VAR                                                     !0
         26        DECLARE_LAMBDA_FUNCTION                              ~10     [2]
         27        SEND_VAL                                                     ~10
         28        DO_ICALL                                             $11     
         29        SEND_VAR                                                     $11
   29    30        DO_ICALL                                                     
   31    31      > 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/F6jo5
function name:  {closure:/in/F6jo5:18}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_DIM_R                                          ~2      !0, 'ITEM'
          3        FETCH_DIM_R                                          ~3      !1, 'ITEM'
          4        SPACESHIP                                            ~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/F6jo5
function name:  {closure:/in/F6jo5:24}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_DIM_R                                          ~2      !0, 'ITEM'
          3        FETCH_DIM_R                                          ~3      !1, 'ITEM'
          4        SPACESHIP                                            ~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
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F6jo5
function name:  {closure:/in/F6jo5:30}
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_DIM_R                                          ~2      !0, 'ITEM'
          3        FETCH_DIM_R                                          ~3      !1, 'ITEM'
          4        IS_IDENTICAL                                                 ~2, ~3
          5      > JMPZ                                                         ~4, ->8
          6    >   QM_ASSIGN                                            ~5      0
          7      > JMP                                                          ->16
          8    >   FETCH_DIM_R                                          ~6      !0, 'ITEM'
          9        FETCH_DIM_R                                          ~7      !1, 'ITEM'
         10        IS_SMALLER                                                   ~7, ~6
         11      > JMPZ                                                         ~8, ->14
         12    >   QM_ASSIGN                                            ~9      1
         13      > JMP                                                          ->15
         14    >   QM_ASSIGN                                            ~9      -1
         15    >   QM_ASSIGN                                            ~5      ~9
         16    > > RETURN                                                       ~5
         17*     > RETURN                                                       null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.35 ms | 1896 KiB | 14 Q