Q. Which of the following is used to instantiate an object in PHP assuming the class name to be Foo?
β
Correct Answer: (A)
$obj = new foo ();
Explanation: class Foo{
//Some code here
}
//Creating object for Foo class
$obj = new Foo();
Note- It is recommended that class name should start with uppercase. For example
class Myclass{
// Code here
}