3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hits = array( array('sortby' => 'String 1', 'html' => '<div>This element contains String 1</div>'), array('sortby' => 'String 11', 'html' => '<div>This element contains String 11</div>'), array('sortby' => 'String 2', 'html' => '<div>This element contains String 2</div>'), ); // Obtain a list of columns foreach ($hits as $key => $row) { $sortby[$key] = $row['sortby']; $html[$key] = $row['html']; } // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key array_multisort($sortby, SORT_ASC, SORT_NATURAL, $hits); echo "<pre>"; print_r($hits); echo "</pre>";
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/YSgdZ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $hits, !1 = $row, !2 = $key, !3 = $sortby, !4 = $html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $6      !0, ->11
          2    > > FE_FETCH_R                                       ~7      $6, !1, ->11
          3    >   ASSIGN                                                   !2, ~7
   10     4        FETCH_DIM_R                                      ~10     !1, 'sortby'
          5        ASSIGN_DIM                                               !3, !2
          6        OP_DATA                                                  ~10
   11     7        FETCH_DIM_R                                      ~12     !1, 'html'
          8        ASSIGN_DIM                                               !4, !2
          9        OP_DATA                                                  ~12
    9    10      > JMP                                                      ->2
         11    >   FE_FREE                                                  $6
   16    12        INIT_FCALL                                               'array_multisort'
         13        SEND_REF                                                 !3
         14        SEND_VAL                                                 4
         15        SEND_VAL                                                 6
         16        SEND_REF                                                 !0
         17        DO_ICALL                                                 
   18    18        ECHO                                                     '%3Cpre%3E'
   19    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   20    22        ECHO                                                     '%3C%2Fpre%3E'
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.23 ms | 1399 KiB | 17 Q