The object's members (properties, methods) are combined into a separate unit, and the inner details of the object are hidden as much as possible.
Here to introduce the "private" keyword, private, with this keyword decorated members, can only be accessed within the object, can not be accessed outside the object
The role of encapsulation methods
Can only be used internally after the 1.private package
2. There are 100 methods in a class that encapsulate 90 (methods for the other 10 services), and only 10 methods can be used
The role of encapsulation properties
1. The member property is equivalent to the global variable of this object, the member property is used in the method, the change of the member property is changing the execution behavior of the method, that is, changing the function of the object.
2. Don't let the object change or read his value outside
The above describes the PHP object-oriented three characteristics of the package, including the content of the text, I hope that the PHP tutorial interested in a friend helpful.