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 php string function?

0 Answers  


What is the use of mysql_real_escape_string() function?

0 Answers  


What is difference between session and cookie in PHP?

0 Answers  


Is it possible to destroy a cookie?

0 Answers  


write a program to print [123] [456] [789] note : braces also need to be printed

2 Answers   Net Solution,


What is the purpose of break and continue statement?

0 Answers  


What are the ways to include file in php?

0 Answers  


> symbol is used to redirect the output of a command. State Whether True or False?

0 Answers  


how can we check mail function with '127.0.0.1' (before submitting a site?

1 Answers  


What is a variable cost example?

0 Answers  


What is a query in php?

0 Answers  


What is a base url?

0 Answers  


Categories