A

Admin • 833.24K Points
Coach

Q. Which of the following is the correct way to create an object in PHP?

  • (A) $obj = new ClassName();
  • (B) $obj = create ClassName();
  • (C) $obj = ClassName();
  • (D) $obj = new object();
  • Correct Answer - Option(A)
  • Views: 37
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

Objects are created in PHP using the 'new' keyword followed by the class name and parentheses.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.