Practice mode PHP

Which PHP keyword is used to create an object from a class?

Correct answer B. new

Explanation

The new keyword creates an instance of a class, for example $car = new Car(); and calls the class constructor if one exists.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.