Menu
Coddy logo textTech

Understanding PHP Errors

Part of the Logic & Flow section of Coddy's PHP journey — lesson 52 of 68.

When you write PHP code, things don't always go as planned. PHP has a built-in system for reporting different types of problems that can occur in your code. Understanding these error types helps you identify what went wrong and how serious the problem is.

Notices are the mildest type of error. They indicate potential issues that don't stop your script from running, such as using an undefined variable. Your code continues to execute, but PHP warns you about something that might cause problems later.

Warnings are more serious than notices but still allow your script to continue running. These occur when PHP encounters a problem like trying to include a file that doesn't exist. The script keeps going, but the problematic operation fails.

Fatal Errors are the most severe type and immediately stop your script from executing. These happen when PHP encounters something it cannot recover from, such as calling a function that doesn't exist or running out of memory. When a fatal error occurs, your script stops completely at that point.

Learning to recognize these different error types in PHP's error messages will help you quickly understand the severity of problems in your code and respond appropriately to fix them.

Try it yourself

This lesson doesn't include a code challenge.

quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Logic & Flow