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

What is xss in php?

0 Answers  


from which profile r you coming?

1 Answers  


How can I embed a java programme in PHP file and what changes have to be done in PHP.ini file?

1 Answers   Sify, Small Biz Express,


Is php better than java?

0 Answers  


Write down the benefits of php7?

0 Answers  






Why do we use javascript in php?

0 Answers  


How to communicate with sockets in php?

1 Answers  


In how many ways we can retrieve the data in the result set of mysql using php?

0 Answers  


Explain about objects in PHP?

0 Answers  


can any one find and tell the difference between dot net and php which one is best ? which one we get more salary? which one is stable and which one is best for freshers and also better in future and carrer ? which one we wil get more salary sir ? please send ur valuable suggestions to kiranpulsar2007@gmail.com

3 Answers  


What does the initials of php stand for?

0 Answers  


How is it possible to set an infinite execution time for php script?

0 Answers  


Categories