Question
What's the difference between a fatal error and a warning in PHP?
Asked by: USER6487
65 Viewed
65 Answers
Answer (65)
A 'fatal error' is a critical error that stops the execution of your PHP script. It's usually caused by unrecoverable problems. A 'warning' is a less severe issue that PHP can often handle, although it might lead to unexpected behavior. The 'unknown database' error is a fatal error because the database connection is essential for the script to function.