freeCodeCamp/guide/portuguese/php/functions/die-and-exit/index.md

22 lines
591 B
Markdown
Raw Normal View History

---
title: Die and Exit
localeTitle: Morrer e sair
---
## Morrer e sair
As funções `die()` e `exit()` são idênticas. Cada um deles recebe um argumento (uma string) contendo uma mensagem de erro. Ao serem executados, eles emitem a mensagem e interrompem imediatamente a execução do script.
```PHP
<?php
die('Die() function was run');
```
```PHP
<?php
exit('Exit() function was run');
```
#### Mais Informações:
* [php.net die () manual](https://secure.php.net/manual/en/function.die.php)
* [manual do php.net exit ()](https://secure.php.net/manual/en/function.exit.php)