How to write a PHP class? _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
How to write a PHP class ?. Well, it sounds very easy, but it is not easy to operate. A few days ago, I talked to the technical director of a company about the application of PHP object-oriented in the company.

Well, it sounds very easy, but it is not easy to operate. A few days ago, I talked to the technical director of a company about the application of PHP object-oriented in the company. The reason is simple, and there is no mandatory reason for you to use objectized PHP. Not only that, but you need to understand one thing. the object-oriented threshold is not low, but the threshold for PHP is very low.

I admit that he is right. Based on my experience over the past few years, many people only understand the basic syntax of PHP class, but some core ideas, such: class creation principles, design patterns, etc. the use of these theoretical knowledge does not have a certain amount of time experience can not really understand. Our troubles are as follows:

1. why?

2. the threshold is high. how can we stick to it?

3. Use cases

4. what are the advantages? why do I have to use the object method to accomplish things using the process method?

Unfortunately, every book that targets objects has an answer. But do we really understand?

We are working on course products. Therefore, I plan to give a practical example of how to use object-oriented courses in the PHP environment. I expect this course to be very easy to use, so I also write it very easily:

1. Introduction to the environment

2. each time you use an instance to explain a small Knowledge Point

3. release all source code to github for sharing

4. the class library can be used directly and updated regularly.

This is an idea, and of course it needs to be implemented.

Bytes. A few days ago, I talked to the technical director of a company about the application of PHP object-oriented in the company...

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.