menu

Debugging in PHP


1. What does the function error_get_last() do in PHP?

Returns the last error that occurred in the script

Returns the last warning that occurred in the script

Returns the last notice that occurred in the script

None of the above


2. What does the function debug_backtrace() do in PHP?

Displays the current stack trace

Displays the current error message

Displays a list of all variables in the current scope

None of the above


3. What is the purpose of the function debug_backtrace() in PHP?

To display a list of all variables in the current scope

To display the current error message

To display the current stack trace

None of the above


4. What is the purpose of the function ini_get() in PHP?

To set the value of a configuration option

To turn off error reporting

To get the value of a configuration option

To stop the execution of the script on an error


5. What does the function set_exception_handler() do in PHP?

Sets a custom function to handle uncaught exceptions

Sets a custom function to handle runtime errors

Sets a custom function to handle syntax errors

None of the above


6. What is the purpose of the function error_clear_last() in PHP?

To clear the last error that occurred in the script

To clear the last warning that occurred in the script

To clear the last notice that occurred in the script

None of the above


7. What is the purpose of the function assert() in PHP?

To stop the execution of the script on an error

To display errors in the browser console

To log errors to a file or database

To test if a condition is true and trigger an error if it is not


8. What does the function trigger_error() do in PHP?

Triggers a runtime error

Triggers a syntax error

Triggers a logical error

None of the above


9. What is the purpose of the function ini_set() in PHP?

To set the value of a configuration option

To turn off error reporting

To display all errors

To stop the execution of the script on an error


10. What is the purpose of the function error_log() in PHP?

To display errors in the browser console

To log errors to a file or database

To stop the execution of the script on an error

None of the above