📅  最后修改于: 2022-03-11 14:54:23.240000             🧑  作者: Mango
// Null Coalesce Operator - $statement ?? ''
$categoryName = $category->name ?? 'Not Available';
// The above Statement is identical to this if/else statement
if (isset($category->name)) {
$categoryName = $category->name;
} else {
$categoryName = 'Not Available';
}