3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(array('date'=>'2014-12-01', 'price'=>'123.00'), array('date'=>'2013-12-01', 'price'=>'123.00'), array('date'=>'2014-02-01', 'price'=>'123.00'), array('date'=>'2014-03-01', 'price'=>'123.00')); var_dump($array); function array_sort_by_column(&$arr, $col, $dir = SORT_ASC) { $sort_col = array(); foreach ($arr as $key=> $row) { $sort_col[$key] = $row[$col]; } array_multisort($sort_col, $dir, $arr); } array_sort_by_column($array, 'date'); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kuOsd
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   16     4        INIT_FCALL                                               'array_sort_by_column'
          5        SEND_REF                                                 !0
          6        SEND_VAL                                                 'date'
          7        DO_FCALL                                      0          
   18     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function array_sort_by_column:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/kuOsd
function name:  array_sort_by_column
number of ops:  18
compiled vars:  !0 = $arr, !1 = $col, !2 = $dir, !3 = $sort_col, !4 = $row, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <const ast>
    7     3        ASSIGN                                                   !3, <array>
    8     4      > FE_RESET_R                                       $7      !0, ->11
          5    > > FE_FETCH_R                                       ~8      $7, !4, ->11
          6    >   ASSIGN                                                   !5, ~8
    9     7        FETCH_DIM_R                                      ~11     !4, !1
          8        ASSIGN_DIM                                               !3, !5
          9        OP_DATA                                                  ~11
    8    10      > JMP                                                      ->5
         11    >   FE_FREE                                                  $7
   12    12        INIT_FCALL                                               'array_multisort'
         13        SEND_REF                                                 !3
         14        SEND_REF                                                 !2
         15        SEND_REF                                                 !0
         16        DO_ICALL                                                 
   13    17      > RETURN                                                   null

End of function array_sort_by_column

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.55 ms | 1399 KiB | 18 Q