Class inheritance in php. In php, class inheritance 1. subclass inherits the parent class using the extends keyword 2. subclass can only inherit from one parent class, but the parent class can inherit from another class 3. when inheriting, it can inherit the class inheritance in the common php of the parent class.
1. subclass inherits the extends keyword used by the parent class
2. subclass can only inherit from one parent class, but the parent class can inherit from another class
3. during inheritance, you can inherit the public/protected attributes and methods of the parent class, and cannot inherit private attributes and methods.
4. in child classes, attributes and methods with the same name as the parent class can be declared to be overwritten. However, the inherited permissions can only be the same or become looser and stricter, for example, if the parent class declares protected $ a, private $ a cannot be declared in the subclass, and public or protected can only be used.
Parent 1. the subclass inherits the parent class with the extends keyword 2. the subclass can only inherit from one parent class, but the parent class can inherit from another class 3, it can inherit the public... of the parent class...