PHP Objects and interfaces abstract class considerations

Source: Internet
Author: User

The implementation of the PHP object:

Note: object names are best named by the object name. class.php.
1. For members of static classes that cannot use $this-> to invoke members and functions of their static classes, they should be invoked using self:: Member or method;

2. For new classes that inherit static classes, the static methods of the parent class need to be called, and should be invoked using the static members and methods of the parent:: Subclass.

3. When defining a class constant, it is defined with a const and cannot be defined with define. Use also needs to be accessed using the self:: constant member.

The implementation of PHP interface

  1. The name of the interface is best named with the i+ interface name. php.
  2. Each implementation of the interface's classes is required;

The implementation of PHP's abstract class

  1. Use the abstract keyword;
  2. The method of the abstract class must be implemented;

PHP Objects and interfaces abstract class considerations

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.