class ConfigReader { private static $ instance = NULL; protected $ configData = array();PHP和單例再次
public function getInstance()
{
if(self::$instance == NULL)
{
self::$instance == new ConfigReader();
}
return self::$instance;
}
public function getConfigValue($getName)
{
echo 'In function';
}
private function __construct()
{
$this->configData = %READ_FROM_DATABASE%;
}
private function __clone() {}
}
併爲:
var_dump(ConfigReader::getInstance())
我:NULL
我打破了腦筋......請幫助我。