note 116906 added to function.die
| From: | contact | Date: | Wed, 18 Mar 2015 19:36:58 +0000 |
| Subject: | note 116906 added to function.die | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201979@lists.php.net to get a copy of this message | ||
The Anonymous user who suggested that die() is not an alias of exit() due to the fact that exit()
takes an exit code, and die() takes an error string is incorrect -- in fact, both can take an exit
code OR a string.
If you pass in an exit code, the script will exit without outputting a message, with the exit code
given.
If you pass in a message instead, the script will exit outputting the message, with an exit code of
0.
In other words, the choice is up to you, but it's probably safer in most circumstances to
simply echo your string, and exit with the intended exit code (or none for 0.)
----
Server IP: 72.52.91.14
Probable Submitter: 173.225.179.34
----
Manual Page -- http://php.net/manual/en/function.die.php
Edit -- https://master.php.net/note/edit/116906
Del: integrated -- https://master.php.net/note/delete/116906/integrated
Del: useless -- https://master.php.net/note/delete/116906/useless
Del: bad code -- https://master.php.net/note/delete/116906/bad+code
Del: spam -- https://master.php.net/note/delete/116906/spam
Del: non-english -- https://master.php.net/note/delete/116906/non-english
Del: in docs -- https://master.php.net/note/delete/116906/in+docs
Del: other reasons-- https://master.php.net/note/delete/116906
Reject -- https://master.php.net/note/reject/116906
Search -- https://master.php.net/manage/user-notes.php