3v4l.org

run code in 500+ PHP versions simultaneously
<?php $biodata = array( array( 'nama' => 'Ayu', 'gender' => 'P', 'usia' => 12, ), array( 'nama' => 'Doni', 'gender' => 'L', 'usia' => 30, ), array( 'nama' => 'Yasina', 'gender' => 'P', 'usia' => 24, ), array( 'nama' => 'Irul', 'gender' => 'L', 'usia' => 20, ), array( 'nama' => 'Abdis', 'gender' => 'L', 'usia' => 21, ), ); $sortColumn = ['gender','usia']; foreach($sortColumn as $column){ usort($biodata, function($a, $b) use ($column){ return $a[$column] > $b[$column]; }); } print_r($biodata);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/bRIMQ
function name:  (null)
number of ops:  16
compiled vars:  !0 = $biodata, !1 = $sortColumn, !2 = $column
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   31     1        ASSIGN                                                       !1, <array>
   32     2      > FE_RESET_R                                           $5      !1, ->11
          3    > > FE_FETCH_R                                                   $5, !2, ->11
   33     4    >   INIT_FCALL                                                   'usort'
          5        SEND_REF                                                     !0
          6        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          7        BIND_LEXICAL                                                 ~6, !2
   35     8        SEND_VAL                                                     ~6
   33     9        DO_ICALL                                                     
   32    10      > JMP                                                          ->3
         11    >   FE_FREE                                                      $5
   39    12        INIT_FCALL                                                   'print_r'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                                     
         15      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bRIMQ
function name:  {closure:/in/bRIMQ:33}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $column
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   34     3        FETCH_DIM_R                                          ~3      !0, !2
          4        FETCH_DIM_R                                          ~4      !1, !2
          5        IS_SMALLER                                           ~5      ~4, ~3
          6      > RETURN                                                       ~5
   35     7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.75 ms | 2346 KiB | 14 Q