3v4l.org

run code in 300+ PHP versions simultaneously
<?php $itemList = array( array(0), array(1), array(0,1), array(0,1,2,3,4), array(new stdClass), array(new stdClass, new stdClass), array(new stdClass, new stdClass, new stdClass) ); function doCompare($a, $b) { if ($a === $b) { return 0; } elseif ($a > $b) { return 1; } return -1; }; foreach ($itemList as $item) { var_dump(array_udiff($item, $item, 'doCompare')); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 37
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 37
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/6j4qG
function name:  (null)
number of ops:  39
compiled vars:  !0 = $itemList, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~2      <array>
          1        ADD_ARRAY_ELEMENT                                ~2      <array>
          2        ADD_ARRAY_ELEMENT                                ~2      <array>
          3        ADD_ARRAY_ELEMENT                                ~2      <array>
    8     4        NEW                                              $3      'stdClass'
          5        DO_FCALL                                      0          
          6        INIT_ARRAY                                       ~5      $3
          7        ADD_ARRAY_ELEMENT                                ~2      ~5
    9     8        NEW                                              $6      'stdClass'
          9        DO_FCALL                                      0          
         10        INIT_ARRAY                                       ~8      $6
         11        NEW                                              $9      'stdClass'
         12        DO_FCALL                                      0          
         13        ADD_ARRAY_ELEMENT                                ~8      $9
         14        ADD_ARRAY_ELEMENT                                ~2      ~8
   10    15        NEW                                              $11     'stdClass'
         16        DO_FCALL                                      0          
         17        INIT_ARRAY                                       ~13     $11
         18        NEW                                              $14     'stdClass'
         19        DO_FCALL                                      0          
         20        ADD_ARRAY_ELEMENT                                ~13     $14
         21        NEW                                              $16     'stdClass'
         22        DO_FCALL                                      0          
         23        ADD_ARRAY_ELEMENT                                ~13     $16
         24        ADD_ARRAY_ELEMENT                                ~2      ~13
    3    25        ASSIGN                                                   !0, ~2
   23    26      > FE_RESET_R                                       $19     !0, ->37
         27    > > FE_FETCH_R                                               $19, !1, ->37
   24    28    >   INIT_FCALL                                               'var_dump'
         29        INIT_FCALL                                               'array_udiff'
         30        SEND_VAR                                                 !1
         31        SEND_VAR                                                 !1
         32        SEND_VAL                                                 'doCompare'
         33        DO_ICALL                                         $20     
         34        SEND_VAR                                                 $20
         35        DO_ICALL                                                 
   23    36      > JMP                                                      ->27
         37    >   FE_FREE                                                  $19
   25    38      > RETURN                                                   1

Function docompare:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6j4qG
function name:  doCompare
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        IS_IDENTICAL                                             !0, !1
          3      > JMPZ                                                     ~2, ->6
   15     4    > > RETURN                                                   0
          5*       JMP                                                      ->9
   16     6    >   IS_SMALLER                                               !1, !0
          7      > JMPZ                                                     ~3, ->9
   17     8    > > RETURN                                                   1
   20     9    > > RETURN                                                   -1
   21    10*     > RETURN                                                   null

End of function docompare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.66 ms | 1400 KiB | 17 Q