>>466
同じ

↓は全部同じ


// 普通にif文
if ($instance) {
return $instance;
} else {
return $instance = new obj();
}

// 三項演算子
return ($instance) ? $instance : $instance = new obj();

// Null合体演算子(PHP7.0〜)
return $instance ?? $instance = new obj();

// Null合体代入演算子(PHP7.4〜)
return $instance ??= new obj();