PHP coding specifications (6) _ PHP Tutorial

Source: Internet
Author: User
PHP coding specification (6 ). 4.2 Single line comment short comments can be displayed in one line and have the same indentation level as the subsequent code. If a comment cannot be written in a row, block comment should be used. Single row note 4.2 Single line comment

A short comment can be displayed in a row and has the same indentation level as the subsequent code. If a comment cannot be written in a row, block comment should be used. There should be a blank line before a single line comment. The following is an example of a single line comment in the code:


If (condition ){

/* Conditions for running the following code */
...
}
4.3 End comments

Very short comments can be in the same line as the code they want to describe, but there should be enough white space to separate the code and comments. If multiple short comments appear in a large code segment, they should have the same indentation.

The following is an example of the end comment in the code:


If ($ a = 2 ){
Return TRUE;/* description of a single condition */
} Else {
Return isPrime ($ a);/* Other conditions */
}


A http://www.bkjia.com/PHPjc/532598.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/532598.htmlTechArticle4.2 single line comment short comment can be displayed within a row and has the same indentation level as the code below. If a comment cannot be written in a row, block comment should be used. Single row 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.