The third option:
$value = (isset($array['key']) ? $array['key'] : null);
I know that this does not directly answer the question; I would put it as a comment, except that it really needed to be formatted.
The idea here is that if you are trying to make your code shorter using a single-line block instead of an if-else block, you can still get it in a concise single-line line using the ternary operator, you are the best of both worlds.
Spudley
source share