Manual talk:Writing testable PHP code

From mediawiki.org
Latest comment: 11 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)Reply
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)Reply
What about die()? Leucosticte (talk) 20:41, 28 October 2012 (UTC)Reply