Php object-oriented programming-PHP development

Source: Internet
Author: User
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:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.