3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = json_decode('{ "data":[ {"roleId":"qai41","role":"qai43","level":"45","sex":"0"}, {"roleId":"qai41","role":"qai41","level":"78","sex":"0"}, {"roleId":"qai41","role":"qai42","level":"44","sex":"0"} ] }', true); function levelSort($a, $b) { if($a['level'] == $b['level']) return 0; return ($a['level']<$b['level']) ? 1 : -1; } usort($t['data'], 'levelSort'); print_r($t['data'][0]['roleId']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NoUbH
function name:  (null)
number of ops:  17
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A++++%22data%22%3A%5B%0A++++++++++++%7B%22roleId%22%3A%22qai41%22%2C%22role%22%3A%22qai43%22%2C%22level%22%3A%2245%22%2C%22sex%22%3A%220%22%7D%2C%0A++++++++++++%7B%22roleId%22%3A%22qai41%22%2C%22role%22%3A%22qai41%22%2C%22level%22%3A%2278%22%2C%22sex%22%3A%220%22%7D%2C%0A++++++++++++%7B%22roleId%22%3A%22qai41%22%2C%22role%22%3A%22qai42%22%2C%22level%22%3A%2244%22%2C%22sex%22%3A%220%22%7D%0A%0A++++++++++%5D%0A%7D'
    9     2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $1      
    2     4        ASSIGN                                                   !0, $1
   15     5        INIT_FCALL                                               'usort'
          6        FETCH_DIM_W                                      $3      !0, 'data'
          7        SEND_REF                                                 $3
          8        SEND_VAL                                                 'levelSort'
          9        DO_ICALL                                                 
   16    10        INIT_FCALL                                               'print_r'
         11        FETCH_DIM_R                                      ~5      !0, 'data'
         12        FETCH_DIM_R                                      ~6      ~5, 0
         13        FETCH_DIM_R                                      ~7      ~6, 'roleId'
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function levelsort

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.17 ms | 1400 KiB | 19 Q