Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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



class Database { public static $_instance; public static function getInstance() { if(!is..

Answer / 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

More PHP Interview Questions

How do I update php?

0 Answers  


How do you use bcrypt for hashing passwords in php?

0 Answers  


"$this" what type of object it is?

2 Answers  


How many bootable file in O/S - XP,2000, and 98. which are the files.

1 Answers   IBM,


What are form input html tags?

0 Answers  






How can we know that a session is started or not?

3 Answers   Rushmore Consultancy,


Is laravel better than codeigniter?

0 Answers  


Why laravel is the best php framework in 2019?

0 Answers  


Difference between mysql_connect and mysql_pconnect in php?

2 Answers  


Explain the importance of the function htmlentities.

0 Answers  


what is CURL?

0 Answers  


What is the difference between urlencode and urldecode ?

3 Answers  






Categories