3v4l.org

run code in 300+ PHP versions simultaneously
<?php $age=array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40"); echo "Sorting the associative array in ascending order by value <br> "; asort($age); foreach($age as $key=>$value) { echo "key is : ".$key." , value is : ".$value." "; } echo "Sorting the associative array in ascending order by key <br> "; ksort($age); foreach($age as $key=>$value) { echo "key is : ".$key." , value is : ".$value." "; } echo "Sorting the associative array in descending order by value <br> "; arsort($age); foreach($age as $key=>$value) { echo "key is : ".$key." , value is : ".$value." "; } echo "Sorting the associative array in descending order by key <br> "; krsort($age); foreach($age as $key=>$value) { echo "key is : ".$key." , value is : ".$value." "; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 42
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 42
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 42
2 jumps found. (Code = 77) Position 1 = 48, Position 2 = 56
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 56
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
Branch analysis from position: 42
Branch analysis from position: 28
Branch analysis from position: 14
filename:       /in/0m6o6
function name:  (null)
number of ops:  58
compiled vars:  !0 = $age, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ECHO                                                     'Sorting+the+associative+array+in+ascending+order+by+value+%3Cbr%3E+++++++'
    4     2        INIT_FCALL                                               'asort'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                                 
    5     5      > FE_RESET_R                                       $5      !0, ->14
          6    > > FE_FETCH_R                                       ~6      $5, !1, ->14
          7    >   ASSIGN                                                   !2, ~6
    7     8        CONCAT                                           ~8      'key+is+%3A+', !2
          9        CONCAT                                           ~9      ~8, '+%2C+value+is+%3A+'
         10        CONCAT                                           ~10     ~9, !1
         11        CONCAT                                           ~11     ~10, '+++'
         12        ECHO                                                     ~11
    5    13      > JMP                                                      ->6
         14    >   FE_FREE                                                  $5
    9    15        ECHO                                                     'Sorting+the+associative+array+in+ascending+order+by+key+%3Cbr%3E+++++++'
   10    16        INIT_FCALL                                               'ksort'
         17        SEND_REF                                                 !0
         18        DO_ICALL                                                 
   11    19      > FE_RESET_R                                       $13     !0, ->28
         20    > > FE_FETCH_R                                       ~14     $13, !1, ->28
         21    >   ASSIGN                                                   !2, ~14
   13    22        CONCAT                                           ~16     'key+is+%3A+', !2
         23        CONCAT                                           ~17     ~16, '+%2C+value+is+%3A+'
         24        CONCAT                                           ~18     ~17, !1
         25        CONCAT                                           ~19     ~18, '+++'
         26        ECHO                                                     ~19
   11    27      > JMP                                                      ->20
         28    >   FE_FREE                                                  $13
   16    29        ECHO                                                     'Sorting+the+associative+array+in+descending+order+by+value+%3Cbr%3E+++++++'
   17    30        INIT_FCALL                                               'arsort'
         31        SEND_REF                                                 !0
         32        DO_ICALL                                                 
   18    33      > FE_RESET_R                                       $21     !0, ->42
         34    > > FE_FETCH_R                                       ~22     $21, !1, ->42
         35    >   ASSIGN                                                   !2, ~22
   20    36        CONCAT                                           ~24     'key+is+%3A+', !2
         37        CONCAT                                           ~25     ~24, '+%2C+value+is+%3A+'
         38        CONCAT                                           ~26     ~25, !1
         39        CONCAT                                           ~27     ~26, '+++'
         40        ECHO                                                     ~27
   18    41      > JMP                                                      ->34
         42    >   FE_FREE                                                  $21
   22    43        ECHO                                                     'Sorting+the+associative+array+in+descending+order+by+key+%3Cbr%3E+++++++'
   23    44        INIT_FCALL                                               'krsort'
         45        SEND_REF                                                 !0
         46        DO_ICALL                                                 
   24    47      > FE_RESET_R                                       $29     !0, ->56
         48    > > FE_FETCH_R                                       ~30     $29, !1, ->56
         49    >   ASSIGN                                                   !2, ~30
   26    50        CONCAT                                           ~32     'key+is+%3A+', !2
         51        CONCAT                                           ~33     ~32, '+%2C+value+is+%3A+'
         52        CONCAT                                           ~34     ~33, !1
         53        CONCAT                                           ~35     ~34, '+++'
         54        ECHO                                                     ~35
   24    55      > JMP                                                      ->48
         56    >   FE_FREE                                                  $29
   29    57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.38 ms | 1392 KiB | 21 Q