[Solved] php oop protected property, protected method, protected construct
This is the purpose of Visibility. In Block 2 your property is protected. This means it can only be accessed the class itself (Database2) and by inherited classes. The error occurs when you try to echo the variable from the outside. The same goes for the method in Block 3. The Constuctor can be protected … Read more