3v4l.org

run code in 300+ PHP versions simultaneously
<?php function key_compare_func($key1, $key2) { if ($key1 == $key2) return 0; else if ($key1 > $key2) return 1; else return -1; } $a=new stdClass; $a->{"0"}=1; $a->n=2; var_dump(array_diff_key((array)$a, [0])); var_dump(array_diff_ukey((array)$a, [0], 'key_compare_func'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rNbGX
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        ASSIGN_OBJ                                               !0, '0'
          4        OP_DATA                                                  1
   15     5        ASSIGN_OBJ                                               !0, 'n'
          6        OP_DATA                                                  2
   16     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'array_diff_key'
          9        CAST                                          7  ~6      !0
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 <array>
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
         14        DO_ICALL                                                 
   17    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'array_diff_ukey'
         17        CAST                                          7  ~9      !0
         18        SEND_VAL                                                 ~9
         19        SEND_VAL                                                 <array>
         20        SEND_VAL                                                 'key_compare_func'
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function key_compare_func:
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/rNbGX
function name:  key_compare_func
number of ops:  12
compiled vars:  !0 = $key1, !1 = $key2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_EQUAL                                                 !0, !1
          3      > JMPZ                                                     ~2, ->6
    6     4    > > RETURN                                                   0
          5*       JMP                                                      ->11
    7     6    >   IS_SMALLER                                               !1, !0
          7      > JMPZ                                                     ~3, ->10
    8     8    > > RETURN                                                   1
          9*       JMP                                                      ->11
   10    10    > > RETURN                                                   -1
   11    11*     > RETURN                                                   null

End of function key_compare_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.94 ms | 1400 KiB | 19 Q