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) { echo 'A: '; var_dump($a); echo 'B: '; var_dump($b); if ($a === $b) { return 0; } elseif ($a > $b) { return 1; } else { return -1; } }; foreach ($itemList as $item) { echo 'Comparing: '; var_dump($item); var_dump(array_udiff($item, $item, 'doCompare')); echo PHP_EOL.PHP_EOL.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 42
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 42
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/gmC8i
function name:  (null)
number of ops:  44
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
   28    26      > FE_RESET_R                                       $19     !0, ->42
         27    > > FE_FETCH_R                                               $19, !1, ->42
   29    28    >   ECHO                                                     'Comparing%3A+'
   30    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                                 
   31    32        INIT_FCALL                                               'var_dump'
         33        INIT_FCALL                                               'array_udiff'
         34        SEND_VAR                                                 !1
         35        SEND_VAR                                                 !1
         36        SEND_VAL                                                 'doCompare'
         37        DO_ICALL                                         $21     
         38        SEND_VAR                                                 $21
         39        DO_ICALL                                                 
   32    40        ECHO                                                     '%0A%0A%0A'
   28    41      > JMP                                                      ->27
         42    >   FE_FREE                                                  $19
   33    43      > RETURN                                                   1

Function docompare:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gmC8i
function name:  doCompare
number of ops:  20
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        ECHO                                                     'A%3A+'
   15     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   16     6        ECHO                                                     'B%3A+'
   17     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   19    10        IS_IDENTICAL                                             !0, !1
         11      > JMPZ                                                     ~4, ->14
   20    12    > > RETURN                                                   0
         13*       JMP                                                      ->19
   21    14    >   IS_SMALLER                                               !1, !0
         15      > JMPZ                                                     ~5, ->18
   22    16    > > RETURN                                                   1
         17*       JMP                                                      ->19
   24    18    > > RETURN                                                   -1
   26    19*     > RETURN                                                   null

End of function docompare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.06 ms | 1392 KiB | 17 Q