Skip to content

NonExistentArrayOffset

An array is accessed with a key that is known not to exist.

<?php
$point = ['x' => 1, 'y' => 2];
echo $point['z']; // key 'z' does not exist in this literal array

Use an existing key or add the key to the array shape definition.