drak/symfony — comment on commit 7390a1e0dc7f0f1135f809ef76bccafad701e329
File: src/Symfony/Component/HttpFoundation/FlashBag.php line 59
By drak:

Check are necessary in a read context because otherwise PHP will create a key and then return `null`. PHP throws a notice to warn you it has done this because we need to know the array key was not initialised and could be the cause of an error.

In a write context, PHP creates the key and writes the value. No notice is emitted by PHP in the write context because we (and PHP both) expect the key to be created.