isset() vs array_key_exists()
The usage of
array_key_exists() is a point that causes some confusion.
The difference between these two built-in functions is how
null is handled.
$firstArray = [ 'a' => 1, ]; // true array_key_exists('a', $firstArray); $secondArray = [ 'b' => null, ]; // false isset($secondArray['b']);
This can be important in cases where you are receiving user inputs, particularly from web forms. There are often cases where a submitted field is PRESENT but NULL.