3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc = array( "a" => 1, "b" => 0, 0 => 0 ); function is_assoc($in_array){ $test_array = ksort($in_array); return !ctype_digit( implode('', array_keys($test_array)) ); } echo is_assoc($assoc); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X8RpN
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>
   14     1        INIT_FCALL                                               'is_assoc'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   16     5      > RETURN                                                   1

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

End of function is_assoc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.44 ms | 1389 KiB | 22 Q