3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = <<<EOT { "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"} ] } EOT; $t = json_decode($t, true); $d = $t['data']; usort($d, function($a, $b){ if($a['level'] == $b['level']) return 0; return ($a['level']>$b['level']) ? 1 : -1; }); print_r($d);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MRpbZ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $t, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%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'
   14     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
   15     6        FETCH_DIM_R                                      ~5      !0, 'data'
          7        ASSIGN                                                   !1, ~5
   17     8        INIT_FCALL                                               'usort'
          9        SEND_REF                                                 !1
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMRpbZ%3A17%240'
   20    11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
   22    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMRpbZ%3A17%240:
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/MRpbZ
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     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
   19     7    >   FETCH_DIM_R                                      ~5      !0, 'level'
          8        FETCH_DIM_R                                      ~6      !1, 'level'
          9        IS_SMALLER                                               ~6, ~5
         10      > JMPZ                                                     ~7, ->13
         11    >   QM_ASSIGN                                        ~8      1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      -1
         14    > > RETURN                                                   ~8
   20    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMRpbZ%3A17%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1400 KiB | 19 Q