22 lines
572 B
Markdown
22 lines
572 B
Markdown
|
---
|
||
|
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)
|