E0036 reports array indexes that can be out of bounds. It is the array-index member of Phanalist’s bounded formal verification family (E0031-E0043). The family shares a Z3-backed engine that encodes path conditions and values, so a finding comes with a solver-backed counterexample rather than a heuristic guess.
list<T> and non-empty-list<T> values, including count()/sizeof()
lengths, appends, foreach keys, and isset() guardsarray_key_first() and array_key_last() on tracked
literal arrays, preserving PHP insertion orderarray_merge() on list inputs and lengths preserved
by array_map(), array_values(), and array_reverse()array<K,V> lengths, including lengths returned through PHPDoc
contractsarray_diff(), array_intersect(), array_unique(),
array_filter(), and array_fill_keys(); exact lengths from array_keys();
count-derived lengths from array_fill(); padded lengths from array_pad();
PHP-compatible offset and length rules for array_slice(); and chunk counts
from array_chunk()array_map()&& chainsunverified under unknown_policy: reportE0036 shares the model limits, loop bounds, and interprocedural behavior described in E0031. It does not assume arbitrary relationships between two lists, such as a key from one list being valid for another. It only uses the length relationships produced by the modeled built-ins and by explicit guards or assertions.
rules:
E0036:
php_version: "8.4"
check_array_index: true
See E0031 for the shared model limits, unknown_policy behavior, and
per-code configuration.