Home > Backend Development > PHP Tutorial > PHP coding standards (9)_PHP tutorial

PHP coding standards (9)_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:20:16
Original
787 people have browsed it

5.1 Number of variables declared per line

It is recommended to declare one statement per line because it makes it easier to write comments. That is,


int $level; // The degree of indentation
int $size; // Determined by tab characters

Be better than,

int $level, $size;

Do not place declarations of different types of variables on the same line, for example:


int $foo, $fooarray[]; //Error

Note: In the above example, a space is placed between the type and identifier. Another allowed alternative is to use the tab character:


int $level; // The degree of indentation
int $size; // Determined by the tab character
$currentEntry; // The tab character is usually selected as the indentation standard


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532595.htmlTechArticle5.1 The number of variables declared per line is recommended to be declared one line at a time, because this makes it easier to write comments. That is, int $level; // The degree of indentation int $size; // determined by tabs is better than i...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template