3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 3 => 1, 7 => 2, 5 => 3, 2 => 4, 0 => 5 ]; echo max(array_keys($array)); // 4 echo sizeof($array)-1; // 4 echo array_search(max($array), $array); // 4
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rIKXR
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   ASSIGN                                                   !0, <array>
  10     1        INIT_FCALL                                               'max'
         2        INIT_FCALL                                               'array_keys'
         3        SEND_VAR                                                 !0
         4        DO_ICALL                                         $2      
         5        SEND_VAR                                                 $2
         6        DO_ICALL                                         $3      
         7        ECHO                                                     $3
  11     8        COUNT                                            ~4      !0
         9        SUB                                              ~5      ~4, 1
        10        ECHO                                                     ~5
  12    11        INIT_FCALL                                               'array_search'
        12        INIT_FCALL                                               'max'
        13        SEND_VAR                                                 !0
        14        DO_ICALL                                         $6      
        15        SEND_VAR                                                 $6
        16        SEND_VAR                                                 !0
        17        DO_ICALL                                         $7      
        18        ECHO                                                     $7
        19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
13.67 ms | 461 KiB | 7 Q