class Database
{
public static $_instance;
public static function getInstance()
{
if(!isset(self::$_instance))
self::$_instance = new Database(DB_SERVER, DB_USER,
DB_PASS, DB_NAME);
print_r(self::$_instance);
return self::$_instance;
}
}
can any one explain "self::$_instance = new
Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);" this line
Answer Posted / guest
self::$_instance = new
Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
It represents object creation of the class 'Database'.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain me is multiple inheritance supported in php?
What are access specifiers?
What is laracast?
What is the use of htmlentities in php?
What are the special characters you need to escape in double-quoted stings?
What is filter_var?
What is singleton design pattern in php?
What are the functions used in php?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
What is session php?
How does php session work?
What type of headers that PHP supports?
What is url encoding and decoding in php?
Which character is used to match exactly one character?
Could we start a variable with number like $4name?