3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isIndexedArray($array) { return !(bool)count(array_filter(array_keys($array), 'is_string')); } assert(isIndexedArray(['a' => ''])); assert(isIndexedArray(['a']));
based on QLfPU
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HM5tr
function name:  (null)
number of ops:  18
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   7     1        ASSERT_CHECK                                             
         2        INIT_FCALL                                               'assert'
         3        INIT_FCALL                                               'isindexedarray'
         4        SEND_VAL                                                 <array>
         5        DO_FCALL                                      0  $0      
         6        SEND_VAR                                                 $0
         7        SEND_VAL                                                 'assert%28isIndexedArray%28%5B%27a%27+%3D%3E+%27%27%5D%29%29'
         8        DO_ICALL                                                 
   8     9        ASSERT_CHECK                                             
        10        INIT_FCALL                                               'assert'
        11        INIT_FCALL                                               'isindexedarray'
        12        SEND_VAL                                                 <array>
        13        DO_FCALL                                      0  $2      
        14        SEND_VAR                                                 $2
        15        SEND_VAL                                                 'assert%28isIndexedArray%28%5B%27a%27%5D%29%29'
        16        DO_ICALL                                                 
        17      > RETURN                                                   1

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

End of function isindexedarray

Generated using Vulcan Logic Dumper, using php 7.3.0