3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "hrid" => 1, "masterroom" => "B4-G-3" ], [ "hrid" => 2, "masterroom" => "B4-G-1" ], [ "hrid" => 7, "masterroom" => "B4-1-2" ], [ "hrid" => 8, "masterroom" => "B4-1-1" ], [ "hrid" => 9, "masterroom" => "B4-1-10" ], [ "hrid" => 10, "masterroom" => "B4-G-10" ] ]; // Pre 5.5 foreach($array as $key => $value) { $hrid[$key] = $value['hrid']; $masterrom[$key] = $value['masterroom']; } // 5.5+ // $masterroom = array_column($array, 'masterroom'); // $hrid = array_column($array, 'hrid'); array_multisort($masterroom, SORT_NATURAL, $hrid, SORT_ASC, $array); var_dump($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Bc88G
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $value, !2 = $key, !3 = $hrid, !4 = $masterrom, !5 = $masterroom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   30     1      > FE_RESET_R                                       $7      !0, ->11
          2    > > FE_FETCH_R                                       ~8      $7, !1, ->11
          3    >   ASSIGN                                                   !2, ~8
   31     4        FETCH_DIM_R                                      ~11     !1, 'hrid'
          5        ASSIGN_DIM                                               !3, !2
          6        OP_DATA                                                  ~11
   32     7        FETCH_DIM_R                                      ~13     !1, 'masterroom'
          8        ASSIGN_DIM                                               !4, !2
          9        OP_DATA                                                  ~13
   30    10      > JMP                                                      ->2
         11    >   FE_FREE                                                  $7
   39    12        INIT_FCALL                                               'array_multisort'
         13        SEND_REF                                                 !5
         14        SEND_VAL                                                 6
         15        SEND_REF                                                 !3
         16        SEND_VAL                                                 4
         17        SEND_REF                                                 !0
         18        DO_ICALL                                                 
   41    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
482 ms | 1011 KiB | 15 Q