php When the class name is the same as the method name, the method becomes a constructor. At this point, instantiate the class, then the program automatically executes this method.
- If the class also has a constructor: __construct( ), then the method with the same name as the class will not be executed.
- Of course, using namespace: namespace, the method with the same name as the class name will become a normal method.