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
Can we override static method?
Explain how to execute a php script using command line.
Tell us why did you choose this particular career path?
What is symfony php?
Why do we use query?
How many open modes available when a file open in PHP?
How can we access the data sent through the url with the post method?
Write a select query that will be displayed the duplicated site name and how many times it is duplicated?
How to merge values of two arrays into a single array?
What is namespaces in PHP?
What backslash character will match whitespace?
How can you increase the maximum execution time of a script in php?
List some features of php that are deprecated in php
What is php? Why it is used?
What is data type in php?