Debugging in PHP
Debugging in PHP - Important Points
1. | Which of the following is a commonly used method for debugging PHP code? |
---|
A. echo statements
B. print_r statements
C. var_dump statements
D. All of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
2. | What is the purpose of the error_reporting() function in PHP? |
---|
A. To turn off error reporting
B. To set the level of error reporting
C. To display all errors
D. To stop the execution of the script on an error
View Answer Discuss Work SpaceAnswer: option b
Explanation:
3. | Which of the following is NOT a type of error that can occur in PHP code? |
---|
A. Syntax errors
B. Runtime errors
C. Logical errors
D. None of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
4. | What does the function debug_backtrace() do in PHP? |
---|
A. Displays the current stack trace
B. Displays the current error message
C. Displays a list of all variables in the current scope
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
5. | What is the purpose of the function ini_set() in PHP? |
---|
A. To set the value of a configuration option
B. To turn off error reporting
C. To display all errors
D. To stop the execution of the script on an error
View Answer Discuss Work SpaceAnswer: option a
Explanation: