Possible Duplicate:
what are the differences in die() and exit() in PHP?
I guess the main question is what is the difference between the 3 exactly?
What is the correct semantic usage for each one of these?
From what I see return false;
can discontinue a function whereas die();
and exit();
will prevent any further code running at all.
Is this correct?
die()
and exit()
are precisely identical; they halt the entire PHP program and return to the OS. They're two different names for the same function.
return
, on the other hand, ends a function call and returns to the caller. At the end of a program, return
sets the status value that is returned to the OS; the program is going to exit no matter what.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With