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) { $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 = 26
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/Olhgm
function name:  (null)
number of ops:  41
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, ->26
         17    > > FE_FETCH_R                                       ~14     $13, !1, ->26
         18    >   ASSIGN                                                   !2, ~14
   12    19        FETCH_DIM_R                                      ~17     !1, 'volume'
         20        ASSIGN_DIM                                               !3, !2
         21        OP_DATA                                                  ~17
   13    22        FETCH_DIM_R                                      ~19     !1, 'edition'
         23        ASSIGN_DIM                                               !4, !2
         24        OP_DATA                                                  ~19
   11    25      > JMP                                                      ->17
         26    >   FE_FREE                                                  $13
   15    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                                 
   18    30        INIT_FCALL                                               'array_multisort'
         31        SEND_REF                                                 !3
         32        SEND_VAL                                                 3
         33        SEND_REF                                                 !4
         34        SEND_VAL                                                 4
         35        SEND_REF                                                 !0
         36        DO_ICALL                                                 
   19    37        INIT_FCALL                                               'print_r'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.82 ms | 1392 KiB | 17 Q