3v4l.org

run code in 300+ PHP versions simultaneously
<?php $your_array = array(0 =>array("codes"=>array(7,4,5)), 1 =>array("codes"=>array(4,45,1))); function aasort (&$array, $key) { $sorter=array(); $ret=array(); reset($array); foreach ($array as $ii => $va) { $sorter[$ii]=$va[$key]; } asort($sorter); foreach ($sorter as $ii => $va) { $ret[$ii]=$array[$ii]; } $array=$ret; } aasort($your_array,"codes"); var_dump($your_array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uA8W
function name:  (null)
number of ops:  9
compiled vars:  !0 = $your_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   19     1        INIT_FCALL                                               'aasort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'codes'
          4        DO_FCALL                                      0          
   20     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function aasort:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 14
filename:       /in/6uA8W
function name:  aasort
number of ops:  28
compiled vars:  !0 = $array, !1 = $key, !2 = $sorter, !3 = $ret, !4 = $va, !5 = $ii
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        ASSIGN                                                   !2, <array>
    7     3        ASSIGN                                                   !3, <array>
    8     4        INIT_FCALL                                               'reset'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
    9     7      > FE_RESET_R                                       $9      !0, ->14
          8    > > FE_FETCH_R                                       ~10     $9, !4, ->14
          9    >   ASSIGN                                                   !5, ~10
   10    10        FETCH_DIM_R                                      ~13     !4, !1
         11        ASSIGN_DIM                                               !2, !5
         12        OP_DATA                                                  ~13
    9    13      > JMP                                                      ->8
         14    >   FE_FREE                                                  $9
   12    15        INIT_FCALL                                               'asort'
         16        SEND_REF                                                 !2
         17        DO_ICALL                                                 
   13    18      > FE_RESET_R                                       $15     !2, ->25
         19    > > FE_FETCH_R                                       ~16     $15, !4, ->25
         20    >   ASSIGN                                                   !5, ~16
   14    21        FETCH_DIM_R                                      ~19     !0, !5
         22        ASSIGN_DIM                                               !3, !5
         23        OP_DATA                                                  ~19
   13    24      > JMP                                                      ->19
         25    >   FE_FREE                                                  $15
   16    26        ASSIGN                                                   !0, !3
   17    27      > RETURN                                                   null

End of function aasort

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.22 ms | 1403 KiB | 20 Q