3v4l.org

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

End of function docompare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.88 ms | 1400 KiB | 17 Q