During this time, I was looking at the windframework and felt that it had a strong object-oriented feature. Although I had a certain foundation for PHP object-oriented programming, but now it seems a little powerless, so I think it is necessary to systematically sort out my knowledge points so that I can read them later and check what I lack in this regard, to make up. Now, let's start from the simplest point, and go through PHP object-oriented programming from start to end. During this time, I was looking at the windframework and felt that it had a strong object-oriented feature. Although I had a certain foundation for PHP object-oriented programming, but now it seems a little powerless, so I think it is necessary to systematically sort out the knowledge about PHP object-oriented programming, so that you can read it later, at the same time, check what you lack in this area to make up for it. Now, let's start from the simplest point, and go through the PHP object-oriented programming knowledge point from start to end.
Php object-oriented programming and other declarations
A class is a set of commands that indicate how to create an object, but it is not an object, but a description of the object. It provides a unified abstract description for all objects in this class, it includes two main parts: attributes and methods. In PHP object-oriented programming language, a class is an independent program unit. It should have a class name and contain two main parts: attribute description and method description.
PHP class declaration is very simple. You only need to start with a keyword class, followed by a custom class name. The class name can be any non-PHP reserved word name. Followed by a pair of curly braces, the bread contains class member and method definitions. In addition, sometimes some modifier class keywords need to be added before the class keywords, such as abstract or final.
Class declaration format
[Modifier class keywords] class name {
Class member:
Class method:
}
Create a class named Person: