3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[] = array('volume' => 67, 'edition' => 2); $data[] = array('volume' => 86, 'edition' => 1); $data[] = array('volume' => 85, 'edition' => 6); $data[] = array('volume' => 98, 'edition' => 2); $data[] = array('volume' => 98, 'edition' => 3); $data[] = array('volume' => 98, 'edition' => 1); $data[] = array('volume' => 86, 'edition' => 6); $data[] = array('volume' => 67, 'edition' => 7); foreach ($data as $key => $row) { echo $key; $volume[$key] = $row['volume']; $edition[$key] = $row['edition']; } print_r($volume); // 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); print_r($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/10nMo
function name:  (null)
number of ops:  42
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>
    8    12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  <array>
    9    14        ASSIGN_DIM                                               !0
         15        OP_DATA                                                  <array>
   11    16      > FE_RESET_R                                       $13     !0, ->27
         17    > > FE_FETCH_R                                       ~14     $13, !1, ->27
         18    >   ASSIGN                                                   !2, ~14
   12    19        ECHO                                                     !2
   13    20        FETCH_DIM_R                                      ~17     !1, 'volume'
         21        ASSIGN_DIM                                               !3, !2
         22        OP_DATA                                                  ~17
   14    23        FETCH_DIM_R                                      ~19     !1, 'edition'
         24        ASSIGN_DIM                                               !4, !2
         25        OP_DATA                                                  ~19
   11    26      > JMP                                                      ->17
         27    >   FE_FREE                                                  $13
   16    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                                 
   19    31        INIT_FCALL                                               'array_multisort'
         32        SEND_REF                                                 !3
         33        SEND_VAL                                                 3
         34        SEND_REF                                                 !4
         35        SEND_VAL                                                 4
         36        SEND_REF                                                 !0
         37        DO_ICALL                                                 
   20    38        INIT_FCALL                                               'print_r'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.27 ms | 1392 KiB | 17 Q