PHP ERROR Constants Flashcards

1
Q

PHP provides several predefined error constants that can be used to identify different types of errors that may occur during the _____

A

execution of a script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

These constants are useful for ____ and ____.

A

error handling
debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

E_ERROR: Represents a ____ error. Execution of the script is ___.

A

fatal run-time
halted

Example: Trying to use a function that does not exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

E_WARNING: Represents a ____ error. The script continues execution, but a warning message is generated.

A

non-fatal run-time

Example: Including a file that does not exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

E_PARSE: Indicates a _ error. This occurs during the compilation of the script and prevents the script from __.

A

parse
running

Example: Syntax errors in the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

E_NOTICE: Represents a _ notice. This indicates that the script encountered something that could be an error, but it is not critical.

A

run-time

Example: Using a variable that has not been initialized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

E_STRICT: This constant indicates suggestions for ____ the code. It is used to help developers write better code by pointing out potential issues.

A

improving
Example: Using a function in a way that is not recommended will trigger an E_STRICT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

E_ALL: This constant represents ____ types. It is often used with the ____ function to enable reporting for all errors, warnings, and notices.

A

all error
error_reporting()

Example: Setting error_reporting(E_ALL); will report all types of errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly