It works fine and doesn't cause problem
echo $formErrorBag[ 'email' ] ?? null
But is it an accepted practice? Never saw an example of this used with null
.
It works fine and doesn't cause problem
echo $formErrorBag[ 'email' ] ?? null
But is it an accepted practice? Never saw an example of this used with null
.
It's completely legal, and accepted. It's a pretty easy and elegant way to avoid raising an E_NOTICE
if $formErrorBag
doesn't have an 'email'
key.