"Proper" PHP with a modern framework such as Laravel is decent and as far as I know would forbid this (there's a global exception handler that returns a 500 page with a stack trace).
Bare PHP with no framework or anything to patch PHP's shortcomings is IMO unacceptable in today's day and age.