note 35236 added to function.exit
| From: | Maxg at rack1 dot php dot net | Date: | Sun, 24 Aug 2003 21:00:18 +0000 |
| Subject: | note 35236 added to function.exit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-55009@lists.php.net to get a copy of this message | ||
Just a note on the behaviour of the exit and die statments.
If you pass an argument, it is supposed to be displayed before the script stops.
However, when you pass an integer or a variable containing an integer, it will be considered as a
exit code and will *not* be displayed.
On the other hand, if you pass a float number, it will be displayed.
<?php
$some_integer = -8;
die($some_integer); // displays nothing
die(8); // Not more
die("Value : ".$some_integer); // Works
die((string)$some_integer); // Works as well
?>
----
Manual Page -- http://www.php.net/manual/en/function.exit.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35236
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35236&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35236&report=yes