PHP Coding Specification (_php) tutorial

Source: Internet
Author: User
8.1 Namespaces

A unique namespace prefix is always all lowercase ascii letters and is a top-level domain name, usually a com,edu,gov,mil,net,org, or an English double-character code for the identity country specified in the 1981 ISO 3166 standard. The subsequent parts of the namespace vary according to the naming conventions of each organization. Such naming conventions may be distinguished by the composition of a particular directory name (department), by Project (project), by machine, or by a registered name (login names), or by a function module.


Name of the 8.2.1 class property

Attribute naming should be prefixed with the character ' M '.
The prefix ' m ' is followed by a rule with a consistent class naming.
' m ' always modifies at the beginning of the name, as if it were a reference to the beginning of ' R '.
Reason
The prefix m prevents any conflicts between class properties and method names. Your method name and attribute name are often very similar, especially for accessing elements.
For example
Class Nameonetwo
{
int $MVARABC;
int $mErrorNumber;
String $mrName;
}


http://www.bkjia.com/PHPjc/532584.html www.bkjia.com true http://www.bkjia.com/PHPjc/532584.html techarticle 8.1 Namespace A unique namespace prefix is always all lowercase ascii letters and is a top-level domain name, usually com,edu,gov,mil,net,org, or the 1981 ISO 3166 standard ...

  • 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.