

MCQOPTIONS
Saved Bookmarks
This section includes 40 Mcqs, each offering curated multiple-choice questions to sharpen your Php knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which exception is thrown by dynamic_cast? |
A. | bad_cast |
B. | bad_typeid |
C. | bad_exception |
D. | bad_alloc |
Answer» B. bad_typeid | |
2. |
How do define the user-defined exceptions? |
A. | inheriting and overriding exception class functionality |
B. | overriding class functionality |
C. | inheriting class functionality |
D. | delting and adding class member |
Answer» B. overriding class functionality | |
3. |
What is the use of the ‘finally’ keyword? |
A. | It used to execute at the starting of the program |
B. | It will be executed at the end of the program even if the exception arised |
C. | It will be executed at the starting of the program even if the exception arised |
D. | It will be executed at the middle of the program even if the exception arised |
Answer» C. It will be executed at the starting of the program even if the exception arised | |
4. |
Which is used to throw a exception? |
A. | throw |
B. | try |
C. | catch |
D. | handler |
Answer» B. try | |
5. |
Which keyword is used to handle the expection? |
A. | try |
B. | throw |
C. | catch |
D. | handler |
Answer» D. handler | |
6. |
Which function is responsible for sending a custom message to the system log? |
A. | systemlog() |
B. | syslog() |
C. | log_system() |
D. | sys_log() |
Answer» C. log_system() | |
7. |
Which logging option’s description is if an error occurs when writing to the syslog, send output to the system console? |
A. | LOG_CONS |
B. | LOG_NDELAY |
C. | LOG_ODELAY |
D. | LOG_PERROR |
Answer» B. LOG_NDELAY | |
8. |
Which function initializes the constants necessary for using the openlog(), clodelog(), and syslog() functions? |
A. | define_variable() |
B. | define_log_variable() |
C. | log_variable() |
D. | define_syslog_variable() |
Answer» E. | |
9. |
Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line? |
A. | ignore_repeated_errors |
B. | ignore_repeat_error |
C. | repeatedly_ignore_error |
D. | repeated_error_ignore |
Answer» B. ignore_repeat_error | |
10. |
Which version introduced the function error_get_last()? |
A. | PHP 4 |
B. | PHP 5 |
C. | PHP 5.2 |
D. | PHP 5.3 |
Answer» D. PHP 5.3 | |
11. |
Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use? |
A. | error_reporting = E_ALL |
B. | error_reporting = E_ERROR | E_PARSE | E_CORE_ERROR |
C. | error_reporting = E_ERROR | E_COMPILE_WARNING | E_CORE_ERROR |
D. | error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR |
Answer» E. | |
12. |
Which character does the error_reporting directive use to represent the logical operator NOT? |
A. | / |
B. | ! |
C. | ~ |
D. | ^ |
Answer» D. ^ | |
13. |
Which version of PHP introduced E_STRICT Error level? |
A. | PHP 4 |
B. | PHP 5 |
C. | PHP 5.2 |
D. | PHP 5.3 |
Answer» C. PHP 5.2 | |
14. |
What is the description of Error level E_ERROR? |
A. | Fatal run-time error |
B. | Near-fatal error |
C. | Compile-time error |
D. | Fatal Compile-time error |
Answer» B. Near-fatal error | |
15. |
How many error levels are available in PHP? |
A. | 14 |
B. | 15 |
C. | 16 |
D. | 17 |
Answer» D. 17 | |
16. |
WHICH_OF_THE_FOLLOWING_IS_GLOBAL_VARIABLE_FOR_ERROR_HANDLING_??$ |
A. | @@ERRORS |
B. | @@ERROR |
C. | @@ERR |
D. | None of the mentioned |
Answer» C. @@ERR | |
17. |
HOW_MANY_LEVELS_ARE_THERE_IN_EXCEPTION_SAFETY??$ |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» B. 2 | |
18. |
ALLOCATED?$ |
A. | Standard exception |
B. | Depends on the memory |
C. | Error |
Answer» B. Depends on the memory | |
19. |
ERRNO_CAUSES_TROUBLE_IN_TWO_SUBTLER_WAYS(VAGUE_AND_EXPLICIT).?$ |
A. | true |
B. | false |
Answer» C. | |
20. |
WHICH_FUNCTION_IS_RESPONSIBLE_FOR_SENDING_A_CUSTOM_MESSAGE_TO_THE_SYSTEM_LOG??$ |
A. | systemlog() |
B. | syslog() |
C. | log_system() |
D. | sys_log() |
Answer» C. log_system() | |
21. |
ERROR_SEVERITY() returns the ________level of the error? |
A. | State number |
B. | Full text |
C. | Severity |
D. | None of the mentioned |
Answer» D. None of the mentioned | |
22. |
What is the use of RAII in c++ programming? |
A. | Improve the exception safety |
B. | Terminate the program |
C. | Exit from the block |
D. | None of the mentioned |
Answer» C. Exit from the block | |
23. |
Which logging option’s description is, if an error occurs when writing to the syslog, send output to the system console?# |
A. | LOG_CONS |
B. | LOG_NDELAY |
C. | LOG_ODELAY |
D. | LOG_PERROR |
Answer» B. LOG_NDELAY | |
24. |
Which of the following is a Error function used within CATCH block ? |
A. | ERROR_STATE() |
B. | ERROR_STATUS() |
C. | ERROR_MSG() |
D. | All of the mentioned |
Answer» B. ERROR_STATUS() | |
25. |
256 |
A. | Invalid argument |
B. | Error |
C. | None of the mentioned |
Answer» D. | |
26. |
Exception |
A. | Error |
B. | My exception |
C. | runtime error |
Answer» D. | |
27. |
Exception handling is possible in SQL Server using : |
A. | THROW |
B. | FINAL |
C. | FINALLY |
D. | All of the mentioned |
Answer» B. FINAL | |
28. |
Invalid value |
A. | Valid value |
B. | No output |
C. | Compile error |
Answer» B. No output | |
29. |
Which of the following benefit does Exception handling with the TRY and CATCH blocks provide ? |
A. | Exceptions provide a mechanism to signal errors directly rather than using some side effects |
B. | Exceptions can be seen by the programmer and checked during the compilation process |
C. | Exceptions provide a clean way to check for errors without cluttering code |
D. | All of the mentioned |
Answer» E. | |
30. |
ERANGE is reported on an overflow or an underflow. |
A. | true |
B. | false |
Answer» B. false | |
31. |
Purpose of TRY…CATCH block in SQL Server is :$ |
A. | Error handling |
B. | Stored Procedure handling |
C. | Message handling |
D. | None of the mentioned |
Answer» B. Stored Procedure handling | |
32. |
c |
A. | |
B. | x |
C. | Both c & x |
Answer» B. x | |
33. |
50 |
A. | 0 |
B. | Division by zero condition! |
C. | Error |
Answer» D. | |
34. |
______ is reported on a domain error. |
A. | EDOM |
B. | ERANGE |
C. | Significance loss |
D. | Underflow |
Answer» B. ERANGE | |
35. |
Which of the following statements can be checked for Errors ? |
A. | CREATE |
B. | DROP |
C. | DELETE |
D. | INSERT |
Answer» E. | |
36. |
What error occurs when a result is undefined for a given argument value?$ |
A. | significance loss |
B. | underflow |
C. | overflow |
D. | domain |
Answer» E. | |
37. |
What is most suitable for returning the logical errors in the program? |
A. | Use constructor and destructor |
B. | Set a global error indicator |
C. | Use break keyword |
D. | None of the mentioned |
Answer» E. | |
38. |
What is the use of the ‘finally’ keyword?$ |
A. | It used to execute at the starting of the program |
B. | It will be executed at the end of the program even if the exception arised |
C. | It will be executed at the starting of the program even if the exception arised |
D. | none of the mentioned |
Answer» B. It will be executed at the end of the program even if the exception arised | |
39. |
What occurs when a result has nowhere near the number of significant digits indicated by its type.$ |
A. | domain |
B. | underflow |
C. | overflow |
D. | significance loss |
Answer» E. | |
40. |
Within main, return expr statement is equivalent to ________ |
A. | abort(expr) |
B. | exit(expr) |
C. | ferror(expr) |
D. | none of the mentioned |
Answer» C. ferror(expr) | |