Which One Of The Following Can Be Used To Instantiate An Object #85
Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?
This multiple choice question (MCQ) is related to the book/course gs gs107 PHP: Hypertext Preprocessor. It can also be found in gs gs107 PHP OOPs - PHP OOPs Basics - Quiz No.1.
Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?
$obj = new $foo;
$obj = new foo;
$obj = new foo ();
obj = new foo ();