3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1400 KiB | 21 Q