Home >php教程 >php手册 >PHP 编码规范(17)

PHP 编码规范(17)

WBOY
WBOYOriginal
2016-06-13 10:20:461031browse

6.9 try...catch语句

一个try-catch语句应该具有如下格式:
try {
  statements;
} catch (ExceptionClass e) {
  statements;
}

一个try-catch语句后面也可能跟着一个finally语句,不论try代码块是否顺利执行完,它都会被执行。
try {
  statements;
} catch (ExceptionClass e) {
  statements;
} finally {
  statements;
}


Statement:
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
Previous article:PHP 编码规范(6)Next article:PHP 编码规范(7)