PHP class constructor


If you want to write a constructor in a class, you must follow the following rules:
a. There cannot be too many actual operations in the constructor. At most, it can be used to initialize some values ​​and variables;
b. You cannot return false or error due to the use of operations in the constructor, because you cannot return errors when declaring and instantiating an object;