Why this matters
Prevents undefined index notices and documents expected defaults.
Use isset()/array_key_exists() or null coalescing (??) before reading array keys that may be absent.
Prevents undefined index notices and documents expected defaults.
Side-by-side examples engineers can pattern-match during review.
$city = $payload['user']['address']['city'];$city = $payload['user']['address']['city'] ?? 'unknown';$v = $a['k'];$v = $a['k'] ?? null;From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.