class ConfigReader { private static $instance = NULL; protected $configData = array();
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() {}
}
And for:
var_dump( ConfigReader::getInstance() )
I got: NULL
I broke by brains... Help me, please.
Just a typo: self::$instance == new ConfigReader() contains == instead of =
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With