-6

I can't understand what is the difference between "exit" and "die" in php

ADyson
  • 51,527
  • 13
  • 48
  • 61
  • 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

0 Answers0