3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_array_assoc($arr) { return array_keys($arr) !== range(0, count($arr) - 1); } $arr = ['test', 'me']; krsort($arr); var_dump(is_array_assoc($arr));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8cSJL
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'krsort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
   12     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'is_array_assoc'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function is_array_assoc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8cSJL
function name:  is_array_assoc
number of ops:  13
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 0
          6        COUNT                                            ~2      !0
          7        SUB                                              ~3      ~2, 1
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        IS_NOT_IDENTICAL                                 ~5      $1, $4
         11      > RETURN                                                   ~5
    7    12*     > RETURN                                                   null

End of function is_array_assoc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.22 ms | 1402 KiB | 22 Q