3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 20; $b = 23; $c = 2; $d = 92; $e = 51; $f = 27; $g = 20; $h = 20; $array = compact(range('a', 'h')); rsort($array); foreach(array_slice($array, 0, 5) as $top) { echo $top, "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 29
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/Wi8q7
function name:  (null)
number of ops:  31
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $f, !6 = $g, !7 = $h, !8 = $array, !9 = $top
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 20
    4     1        ASSIGN                                                   !1, 23
    5     2        ASSIGN                                                   !2, 2
    6     3        ASSIGN                                                   !3, 92
    7     4        ASSIGN                                                   !4, 51
    8     5        ASSIGN                                                   !5, 27
    9     6        ASSIGN                                                   !6, 20
   10     7        ASSIGN                                                   !7, 20
   12     8        INIT_FCALL                                               'compact'
          9        INIT_FCALL                                               'range'
         10        SEND_VAL                                                 'a'
         11        SEND_VAL                                                 'h'
         12        DO_ICALL                                         $18     
         13        SEND_VAR                                                 $18
         14        DO_ICALL                                         $19     
         15        ASSIGN                                                   !8, $19
   13    16        INIT_FCALL                                               'rsort'
         17        SEND_REF                                                 !8
         18        DO_ICALL                                                 
   15    19        INIT_FCALL                                               'array_slice'
         20        SEND_VAR                                                 !8
         21        SEND_VAL                                                 0
         22        SEND_VAL                                                 5
         23        DO_ICALL                                         $22     
         24      > FE_RESET_R                                       $23     $22, ->29
         25    > > FE_FETCH_R                                               $23, !9, ->29
   16    26    >   ECHO                                                     !9
         27        ECHO                                                     '%0A'
   15    28      > JMP                                                      ->25
         29    >   FE_FREE                                                  $23
   17    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.63 ms | 1004 KiB | 17 Q