If you are tired of doing this:


isset($myArray['index']) ? $myArray['index'] : false;

In PHP 7 you can now use the null coalescing operator (??), which helps reduce the amount of code you have to write for such a common practice:


$myArray['index'] ?? false;

Leave a Reply