3v4l.org

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

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

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.16 ms | 1400 KiB | 17 Q