---
title: "analyse/undefined/offset"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="analyse/undefined/offset" />

In the [`analyse-essential`](/docs/rules/presets/analyse-essential) preset and every stricter one. Report only.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"undefined/offset" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`NonexistentOffsetInArrayDimFetchRule`](https://phpstan.org/error-identifiers/class.notFound) (phpstan-classes)
- [`PossiblyUndefinedArrayIndex`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`PossiblyUndefinedIntArrayIndex`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`PossiblyUndefinedStringArrayIndex`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`UndefinedIntArrayIndex`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`UndefinedStringArrayIndex`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`offsetAccess.nonOffsetAccessible`](https://phpstan.org/error-identifiers/offsetAccess.nonOffsetAccessible) (phpstan)
- [`offsetAccess.notFound`](https://phpstan.org/error-identifiers/offsetAccess.notFound) (phpstan)

[More analyse/undefined rules](/docs/rules/analyse/undefined) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
