3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "0" => 12 , "1" => 17 , "2" => 5, "3" => 27, "4" => 5 ); print_r($array); $i=1; foreach($array as $key=>$values) { echo max($array)."rank is ". $i."\n"; if(!in_array($values,$array)) $i++; unset($array[$key]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 24
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 24
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 22
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/fjGpR
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $i, !2 = $values, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4        ASSIGN                                                   !1, 1
    8     5      > FE_RESET_R                                       $7      !0, ->24
          6    > > FE_FETCH_R                                       ~8      $7, !2, ->24
          7    >   ASSIGN                                                   !3, ~8
   10     8        INIT_FCALL                                               'max'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $10     
         11        CONCAT                                           ~11     $10, 'rank+is+'
         12        CONCAT                                           ~12     ~11, !1
         13        CONCAT                                           ~13     ~12, '%0A'
         14        ECHO                                                     ~13
   12    15        INIT_FCALL                                               'in_array'
         16        SEND_VAR                                                 !2
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $14     
         19        BOOL_NOT                                         ~15     $14
         20      > JMPZ                                                     ~15, ->22
   13    21    >   PRE_INC                                                  !1
   15    22    >   UNSET_DIM                                                !0, !3
    8    23      > JMP                                                      ->6
         24    >   FE_FREE                                                  $7
   17    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.66 ms | 1395 KiB | 19 Q