3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[] = array('volume' => 67, 'edition' => 6); $data[] = array('volume' => 86, 'edition' => 5); $data[] = array('volume' => 85, 'edition' => 4); $data[] = array('volume' => 98, 'edition' => 3); $data[] = array('volume' => 86, 'edition' => 2); $data[] = array('volume' => 67, 'edition' => 1); // Obtain a list of columns foreach ($data as $key => $row) { $volume[$key] = $row['volume']; $edition[$key] = $row['edition']; } // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key array_multisort($volume, SORT_DESC, $edition, SORT_ASC, $data); echo '<pre>'; print_r($volume); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/Oj5kX
function name:  (null)
number of ops:  35
compiled vars:  !0 = $data, !1 = $row, !2 = $key, !3 = $volume, !4 = $edition
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    3     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    4     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  <array>
    5     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  <array>
    6     8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  <array>
    7    10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  <array>
    9    12      > FE_RESET_R                                       $11     !0, ->22
         13    > > FE_FETCH_R                                       ~12     $11, !1, ->22
         14    >   ASSIGN                                                   !2, ~12
   10    15        FETCH_DIM_R                                      ~15     !1, 'volume'
         16        ASSIGN_DIM                                               !3, !2
         17        OP_DATA                                                  ~15
   11    18        FETCH_DIM_R                                      ~17     !1, 'edition'
         19        ASSIGN_DIM                                               !4, !2
         20        OP_DATA                                                  ~17
    9    21      > JMP                                                      ->13
         22    >   FE_FREE                                                  $11
   16    23        INIT_FCALL                                               'array_multisort'
         24        SEND_REF                                                 !3
         25        SEND_VAL                                                 3
         26        SEND_REF                                                 !4
         27        SEND_VAL                                                 4
         28        SEND_REF                                                 !0
         29        DO_ICALL                                                 
   17    30        ECHO                                                     '%3Cpre%3E'
   18    31        INIT_FCALL                                               'print_r'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
   19    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.7 ms | 1396 KiB | 17 Q