Trying to access array offset on value of type bool in PHP 7.4

Easy with PHP ?? null coalescing operator

return $Row['Data'] ?? 'default value';

Or you can use as such

$Row['Data'] ??= 'default value';
return $Row['Data'];

Leave a Comment