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

22 lines
572 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Die and Exit
localeTitle: Morir y salir
---
## Morir y salir
Las funciones `die()` y `exit()` son idénticas. Cada uno toma un argumento (una cadena) que contiene un mensaje de error. Al ejecutarse, emiten el mensaje y detienen inmediatamente la ejecución del script.
```PHP
<?php
die('Die() function was run');
```
```PHP
<?php
exit('Exit() function was run');
```
#### Más información:
* [php.net die () manual](https://secure.php.net/manual/en/function.die.php)
* [php.net exit () manual](https://secure.php.net/manual/en/function.exit.php)