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

PHP coding standards (26)_PHP tutorial

WBOY
Release: 2016-07-13 17:20:31
Original
901 people have browsed it

9.3.3 Return value

Find ways to structure your program to fit its purpose. For example:
if (booleanExpression) {
return true;
} else {
return false;
}

should be replaced by the following method:
return booleanExpression ;

Similarly:
if (condition) {
  return x;
}
return y;

should be written as:
return (condition ? x : y);


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532578.htmlTechArticle9.3.3 Return values ​​Try to make your program structure fit for purpose. For example: if (booleanExpression) { return true; } else { return false; } should be replaced by the following method: return booleanExpr...
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template