3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr['i1'] = 99; $arr['i2'] = 89; function cmp($a, $b) { global $arr; if ($arr[$a] > $arr[$b]) { return 1; } if ($arr[$a] < $arr[$b]) { return -1; } return 0; } if (uksort($arr, 'cmp')) { echo "success"; } else { echo "failure"; } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AhIPN
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 'i1'
          2        OP_DATA                                                  99
    5     3        ASSIGN_DIM                                               !0, 'i2'
          4        OP_DATA                                                  89
   17     5        INIT_FCALL                                               'uksort'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'cmp'
          8        DO_ICALL                                         $4      
          9      > JMPZ                                                     $4, ->12
   19    10    >   ECHO                                                     'success'
         11      > JMP                                                      ->13
   23    12    >   ECHO                                                     'failure'
   26    13    >   INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.77 ms | 1396 KiB | 17 Q