Manual talk:Writing testable PHP code
Add topicAppearance
Latest comment: 12 years ago by Leucosticte in topic Do not use exit()
Do not use exit()
[edit]What alternative should one use?
- Nothing. Unless you're checking for a proper entry point there's very little reason to abruptly halt execution like that. Johnduhart 02:53, 24 October 2011 (UTC)
- I've clarified the section a little bit. Ideally if your code encounters an unexpected error, you should throw a MWException. ^demon 12:15, 28 October 2011 (UTC)
- What about die()? Leucosticte (talk) 20:41, 28 October 2012 (UTC)
- I've clarified the section a little bit. Ideally if your code encounters an unexpected error, you should throw a MWException. ^demon 12:15, 28 October 2011 (UTC)