3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "channels" => [ "0" => [ "position" => 5, "id" => 11, "name" => "AFK", ], "1" => [ "position" => 1, "id" => 22, "name" => "ARK", ], "2" => [ "position" => 2, "id" => 33, "name" => "ESO", ], "3" => [ "position" => 4, "id" => 44, "name" => "semi-afk", ], "4" => [ "position" => 0, "id" => 55, "name" => "SPACE", ], "5" => [ "position" => 3, "id" => 66, "name" => "Tanks & Ships", ], ] ]; usort($array['channels'], function($a, $b) { return $a['position'] > $b['position'] ? 1 : -1; }); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2F4TH
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   49     1        INIT_FCALL                                               'usort'
          2        FETCH_DIM_W                                      $2      !0, 'channels'
          3        SEND_REF                                                 $2
          4        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   51     5        SEND_VAL                                                 ~3
   49     6        DO_ICALL                                                 
   53     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2F4TH
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   50     2        FETCH_DIM_R                                      ~2      !0, 'position'
          3        FETCH_DIM_R                                      ~3      !1, 'position'
          4        IS_SMALLER                                               ~3, ~2
          5      > JMPZ                                                     ~4, ->8
          6    >   QM_ASSIGN                                        ~5      1
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~5      -1
          9    > > RETURN                                                   ~5
   51    10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.19 ms | 1011 KiB | 15 Q