Originally Posted by ycpc55
i been watching tutorial after tutorial, and a lot of them been saying its better to make your die function nice and clean. Also doing so will help secure your script better is this true?
IMO, die() makes your page primarily invalid. either you send (no) text where there should be full HTML page or a truncated HTML page. neither is what the user expects to see.
additionally, debugging info is not supposed to get public. you’d better logging that or sending yourself an email of it (or do both).
if a critical error occurs, send the user an error page to explain that something happened that out of the regular.
and therefore I’m a fan of exceptions.