如果我檢查對象是否已經存在於像php這樣的語言中有什麼優勢嗎?在initalizie之前檢查變量有意義嗎?
/**
* User object
* @var My_Model_User
*/
protected $user = null;
/**
* Setup
*/
public function __construct()
{
if ($this->user === null) {
$this->user = new stdClass();
}
}