PHP Coding Specification (_php) tutorial

Source: Internet
Author: User
6.5 for statement

A For statement should have the following format:


for (initialization; condition; update) {
statements;
}

An empty for statement (all work done in initialization, conditional judgment, and UPDATE clauses) should have the following format:


for (initialization; condition; update);

When using commas in the initialization or update clauses of a for statement, avoid using more than three variables, which results in a higher degree of complexity. If required, separate statements can be used before the For loop (for an initialization clause) or for the end of a for loop (for an update clause).

6.6 While statement

A while statement should have the following format
while (condition) {
statements;
}

An empty while statement should have the following format:
while (condition);
6.7 do...while Statements

A do-while statement should have the following format:

do {
statements;
} while (condition);


http://www.bkjia.com/PHPjc/532589.html www.bkjia.com true http://www.bkjia.com/PHPjc/532589.html techarticle 6.5 For statement A For statement should have the following format: for (initialization; condition; update) {statements;} an empty for statement (all work is initialized, condition judged, more ...)

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