PHP 編碼規(guī)范(17)
發(fā)表時(shí)間:2024-06-07 來(lái)源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]6.9 try...catch語(yǔ)句一個(gè)try-catch語(yǔ)句應(yīng)該具有如下格式:try { statements;} catch (ExceptionClass e) { statements;}一個(gè)try-catch語(yǔ)句后面也可能跟著一個(gè)finally語(yǔ)句,不論try代碼塊是否順利執(zhí)行完,它都...
6.9 try...catch語(yǔ)句一個(gè)try-catch語(yǔ)句應(yīng)該具有如下格式:
try {
statements;
} catch (ExceptionClass e) {
statements;
}
一個(gè)try-catch語(yǔ)句后面也可能跟著一個(gè)finally語(yǔ)句,不論try代碼塊是否順利執(zhí)行完,它都會(huì)被執(zhí)行。
try {
statements;
} catch (ExceptionClass e) {
statements;
} finally {
statements;
}