3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $items = array(new \stdClass(), new \stdClass()); $copy = array(); foreach ($items as $item) { $copy[] = $item; } $udiff = array_udiff($items, $copy, function ($a, $b) { return $a === $b; }); var_dump($diff, $udiff, $items, $copy);
based on a2HNT
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
Jump found. Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
Jump found. Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 13
Jump found. Position 1 = -2
Branch analysis from position: 13
filename:       /in/MQeLt
function name:  (null)
number of ops:  28
compiled vars:  !0 = $items, !1 = $copy, !2 = $item, !3 = $udiff, !4 = $diff
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NEW                                              $5      :-6
         1        DO_FCALL                                      0          
         2        INIT_ARRAY                                       ~7      $5
         3        NEW                                              $8      :-4
         4        DO_FCALL                                      0          
         5        ADD_ARRAY_ELEMENT                                ~7      $8
         6        ASSIGN                                                   !0, ~7
   5     7        ASSIGN                                                   !1, <array>
   7     8      > FE_RESET_R                                       $12     !0, ->13
         9    > > FE_FETCH_R                                               $12, !2, ->13
   8    10    >   ASSIGN_DIM                                               !1
        11        OP_DATA                                                  !2
        12      > JMP                                                      ->9
        13    >   FE_FREE                                                  $12
  11    14        INIT_FCALL                                               'array_udiff'
        15        SEND_VAR                                                 !0
        16        SEND_VAR                                                 !1
        17        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMQeLt0x7f2a0b8b20cb'
  13    18        SEND_VAL                                                 ~14
        19        DO_ICALL                                         $15     
        20        ASSIGN                                                   !3, $15
  15    21        INIT_FCALL                                               'var_dump'
        22        SEND_VAR                                                 !4
        23        SEND_VAR                                                 !3
        24        SEND_VAR                                                 !0
        25        SEND_VAR                                                 !1
        26        DO_ICALL                                                 
        27      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMQeLt0x7f2a0b8b20cb:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/MQeLt
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  12     2        IS_IDENTICAL                                     ~2      !0, !1
         3      > RETURN                                                   ~2
  13     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMQeLt0x7f2a0b8b20cb

Generated using Vulcan Logic Dumper, using php 7.2.0