3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc = array( "a" => 1, "b" => 0, 0 => 0 ); function is_assoc($array){ return !ctype_digit( implode('', ksort(array_keys($array))) ); } echo is_assoc($assoc); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/feSgX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $assoc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'is_assoc'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   15     5      > RETURN                                                   1

Function is_assoc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/feSgX
function name:  is_assoc
number of ops:  17
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'ctype_digit'
          2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 ''
          4        INIT_FCALL                                               'ksort'
          5        INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $1      
          8        SEND_VAR_NO_REF                               0          $1
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                         $4      
         14        BOOL_NOT                                         ~5      $4
         15      > RETURN                                                   ~5
   11    16*     > RETURN                                                   null

End of function is_assoc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.16 ms | 1398 KiB | 22 Q