note 24201 added to function.exit
| From: | shaun at NOshatSPAM dot net | Date: | Fri, 09 Aug 2002 08:13:39 +0000 |
| Subject: | note 24201 added to function.exit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34595@lists.php.net to get a copy of this message | ||
return may be preferable to exit in certain situations, especially when dealing with the PHP binary
and the shell.
I have a script which is the recipient of a mail alias, i.e. mail sent to that alias is piped to the
script instead of being delivered to a mailbox. Using exit in this script resulted in the sender of
the email getting a delivery failure notice. This was not the desired behavior, I wanted to silently
discard messages which did not satisfy the script's requirements.
After several hours of trying to figure out what integer value I should pass to exit() to satisfy
sendmail, I tried using return instead of exit. Worked like a charm. Sendmail didn't like exit
but it was perfectly happy with return. So, if you're running into trouble with exit and other
system binaries, try using return instead.
--
http://www.php.net/manual/en/function.exit.php
http://master.php.net/manage/user-notes.php?action=edit+24201
http://master.php.net/manage/user-notes.php?action=delete+24201
http://master.php.net/manage/user-notes.php?action=reject+24201