Problem Statement
What is the name of the function automatically called when an object is created?
Explanation
The __construct() method is called automatically when a class object is created. It is used to initialize values.
Example:
class Car { function __construct(){ echo 'Car ready'; } }
Code Solution
SolutionRead Only
class Car {
function __construct(){ echo 'Object created'; }
}