PHP ERROR Constants Flashcards
PHP provides several predefined error constants that can be used to identify different types of errors that may occur during the _____
execution of a script.
These constants are useful for ____ and ____.
error handling
debugging
E_ERROR: Represents a ____ error. Execution of the script is ___.
fatal run-time
halted
Example: Trying to use a function that does not exist.
E_WARNING: Represents a ____ error. The script continues execution, but a warning message is generated.
non-fatal run-time
Example: Including a file that does not exist.
E_PARSE: Indicates a _ error. This occurs during the compilation of the script and prevents the script from __.
parse
running
Example: Syntax errors in the code.
E_NOTICE: Represents a _ notice. This indicates that the script encountered something that could be an error, but it is not critical.
run-time
Example: Using a variable that has not been initialized.
E_STRICT: This constant indicates suggestions for ____ the code. It is used to help developers write better code by pointing out potential issues.
improving
Example: Using a function in a way that is not recommended will trigger an E_STRICT.
E_ALL: This constant represents ____ types. It is often used with the ____ function to enable reporting for all errors, warnings, and notices.
all error
error_reporting()
Example: Setting error_reporting(E_ALL); will report all types of errors