How do you create an object in PHP?
- Using the new keyword and the class name
- Using the create() function and the class name
- Using the instanceof keyword and the class name
- Using the object() function and the class name
In PHP, to create an object from a class, you would use the new keyword followed by the class name and parentheses. The correct option is "Using the new keyword and the class name." This instantiates an object based on the defined class. For more information, consult the PHP documentation on creating objects: http://php.net/manual/en/language.oop5.php
Loading...