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[1] = 'test'; var_dump(is_array_assoc($arr));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9UFQg
function name:  (null)
number of ops:  9
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_DIM                                               !0, 1
          1        OP_DATA                                                  'test'
   10     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'is_array_assoc'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function is_array_assoc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9UFQg
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:
184.13 ms | 1397 KiB | 20 Q