3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['columnName' => 3], ['columnName' => 4], ['columnName' => 1], ['columnName' => 3], ['columnName' => 2], ['columnName' => 5] ]; $direction = 'desc'; $c = 'columnName'; array_multisort( array_column($array, $c), $direction === 'desc' ? SORT_DESC : SORT_ASC, $array ); var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XIV6h
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $direction, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, 'desc'
   13     2        ASSIGN                                                   !2, 'columnName'
   15     3        INIT_FCALL                                               'array_multisort'
   16     4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8        SEND_VAL                                                 $6
   17     9        IS_IDENTICAL                                             !1, 'desc'
         10      > JMPZ                                                     ~7, ->13
         11    >   QM_ASSIGN                                        ~8      3
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      4
         14    >   SEND_VAL                                                 ~8
   18    15        SEND_REF                                                 !0
   15    16        DO_ICALL                                                 
   21    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.95 ms | 999 KiB | 16 Q