3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_compare($a, $b) { if ($a < $b) { return -1; } elseif ($a > $b) { return 1; } return 0; } $all = array('first' => 5, 'second' => 5); uasort($all, 'my_compare'); print_r($all);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYVu1
function name:  (null)
number of ops:  9
compiled vars:  !0 = $all
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'my_compare'
          4        DO_ICALL                                                 
   15     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function my_compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
245.46 ms | 1003 KiB | 15 Q