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

Is java is better than php?

0 Answers  


What library is used for pdf in php?

0 Answers  


can any one tell how to install LAMP server in terminal in ubuntu.....and also tell please how to run php files in ubunut and how to save and compile in ubuntu..i already installed ubuntu ..but i dont installed lamp server so i want to install lamp server in terminal is it possible please reply

2 Answers  


Why do we use htaccess

0 Answers  


Which is faster for or foreach?

0 Answers  






•How to access crystal reports through PHP code?

1 Answers   Satyam,


What is session cookies php?

0 Answers  


what is the difference between GET,POST and REQUEST in php

1 Answers  


What is a persistent cookie in php?

0 Answers  


How to include variables in double-quoted strings?

0 Answers  


How to calculate the difference between two dates using php?

0 Answers  


Why ide is recommended for use while programming with php?

0 Answers  


Categories