I can't understand what is the difference between "exit" and "die" in php
Asked
Active
Viewed 31 times
-6
-
Die is to be used when you want the script to exit with vengeance. PHP gives you that power and freedom of expression. For example, `is_finished() && exit('Well done sir')` vs. `is_spam() && die('Killed your spam hahaha')`. They will do the exact same thing, but choice of words may give you added satisfaction. – Markus AO May 06 '22 at 17:01