PHP Code Specification (6) _php Tutorial

Source: Internet
Author: User
4.2 Single-line comment

Short annotations can be displayed in a single line and have the same indentation level as the code behind them. If a comment cannot be written in one line, it should take a block comment. There should be a blank line before a single-line comment. Here is an example of a single line comment in the code:


if (condition) {

/* The following code runs the condition */
...
}
4.3 Tail end Comment

Very short annotations can be on the same line as the code they are describing, but there should be enough whitespace to separate the code and comments. If more than one short note appears in a large segment of code, they should have the same indentation.

The following is an example of an end note in a code:


if ($a = = 2) {
return TRUE; /* Description of the single condition */
} else {
return IsPrime ($a); /* The rest of the conditions */
}


http://www.bkjia.com/PHPjc/532598.html www.bkjia.com true http://www.bkjia.com/PHPjc/532598.html techarticle 4.2 Single-line comment a short comment can be displayed in one line and has the same indentation level as the code behind it. If a comment cannot be written in one line, it should take a block comment. Single-line note ...

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