PHP tente palavra- chave
Exemplo
Use uma instrução try...catch para lidar com exceções:
<?php
try {
throw new Exception("This is an exception");
}
catch(Exception $e) {
echo $e->getMessage();
}
?>
Definição e uso
A try
palavra-chave é usada para criar um try...catch
ou uma try...catch...finally
instrução.
Páginas relacionadas
A palavra- throw
chave.
A palavra- catch
chave.
A palavra- finally
chave.
Leia mais sobre try..catch.finally (Exceções) em nosso Tutorial de Exceções do PHP .
❮ Palavras-chave PHP