Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?

a) $obj = new $foo;
b) $obj = new foo;
c) $obj = new foo ()
d) obj = new foo ();

Answer: c
Explanation: To create a new object in PHP we can use the new statement to instantiate a class.

Join The Discussion