menu

Debugging in PHP

Debugging in PHP - Important Points


16. What is the difference between the var_dump() and print_r() functions in PHP?

A. There is no difference, they are synonyms

B. var_dump() displays the type and value of a variable, print_r() only displays the value

C. print_r() displays the type and value of a variable, var_dump() only displays the value

D. None of the above

Discuss Work Space

Answer: option b

Explanation:

The var_dump() function displays the type and value of a variable, while print_r() only displays the value.

17. What is the purpose of the function set_time_limit() in PHP?

A. To turn off error reporting

B. To set the maximum execution time for a script

C. To display all errors

D. To stop the execution of the script on an error

Discuss Work Space

Answer: option b

Explanation:

The set_time_limit() function is used to set the maximum execution time for a script.

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

A. To set the value of a configuration option

B. To turn off error reporting

C. To get the value of a configuration option

D. To stop the execution of the script on an error

Discuss Work Space

Answer: option c

Explanation:

The ini_get() function is used to get the value of a configuration option.

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

A. To clear the last error that occurred in the script

B. To clear the last warning that occurred in the script

C. To clear the last notice that occurred in the script

D. None of the above

Discuss Work Space

Answer: option a

Explanation:

The error_clear_last() function is used to clear the last error that occurred in the script.

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

A. To display a list of all variables in the current scope

B. To display the current error message

C. To display the current stack trace

D. None of the above

Discuss Work Space

Answer: option c

Explanation:

The debug_backtrace() function is used to display the current stack trace in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now