What are the differences in die() and exit() in PHP?

coderex picture coderex · Nov 25, 2009 · Viewed 268.8k times · Source

What are the differences between die() and exit() functions in PHP?

I think both have the same functionality, but I doubt there is something different in both... what is it?

Answer

Marek Karbarz picture Marek Karbarz · Nov 25, 2009

There's no difference - they are the same.

PHP Manual for exit:

Note: This language construct is equivalent to die().

PHP Manual for die:

This language construct is equivalent to exit().