3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr['i1'] = 99; $arr['i2'] = 89; function cmp($a, $b) { if ($GLOBALS['arr'][$a] > $GLOBALS['arr'][$b]) { return 1; } if ($GLOBALS['arr'][$a] < $GLOBALS['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/8VI5h
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
   16     5        INIT_FCALL                                               'uksort'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'cmp'
          8        DO_ICALL                                         $4      
          9      > JMPZ                                                     $4, ->12
   18    10    >   ECHO                                                     'success'
         11      > JMP                                                      ->13
   22    12    >   ECHO                                                     'failure'
   25    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 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8VI5h
function name:  cmp
number of ops:  22
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        FETCH_R                      global              ~2      'GLOBALS'
          3        FETCH_DIM_R                                      ~3      ~2, 'arr'
          4        FETCH_DIM_R                                      ~4      ~3, !0
          5        FETCH_R                      global              ~5      'GLOBALS'
          6        FETCH_DIM_R                                      ~6      ~5, 'arr'
          7        FETCH_DIM_R                                      ~7      ~6, !1
          8        IS_SMALLER                                               ~7, ~4
          9      > JMPZ                                                     ~8, ->11
         10    > > RETURN                                                   1
   12    11    >   FETCH_R                      global              ~9      'GLOBALS'
         12        FETCH_DIM_R                                      ~10     ~9, 'arr'
         13        FETCH_DIM_R                                      ~11     ~10, !0
         14        FETCH_R                      global              ~12     'GLOBALS'
         15        FETCH_DIM_R                                      ~13     ~12, 'arr'
         16        FETCH_DIM_R                                      ~14     ~13, !1
         17        IS_SMALLER                                               ~11, ~14
         18      > JMPZ                                                     ~15, ->20
         19    > > RETURN                                                   -1
   13    20    > > RETURN                                                   0
   14    21*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.63 ms | 1400 KiB | 17 Q