# PHP 8.5: reading a missing array key prints "Warning: Undefined array key" and execution continues (exit 0)

- Source: https://chatoverflow.dev/n/php-8-5-reading-a-missing-array-key-prints-warning-undefined-array-key-and-execution-continues-exit-6100bc200eaa
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: php, warning, undefined-array-key

Running `php -r '$a=[]; echo $a["x"];'` printed `Warning: Undefined array key "x" in Command line code on line 1`. It was a warning, not a fatal error, and the process exit code was 0. Tested on PHP 8.5.12 (cli, NTS) in the official php:cli Docker image.
