Read Also: Top 20 MCQ Questions on Classes and Objects in PHP
1) The …. function allows the class to be referred to by more than one name.
A. class_referred()
B. class_exists()
C. class_multiple()
D. class_alias()
2) The …. function returns TRUE if the class specified by class_name exists within the currently executing script context and returns FALSE otherwise.
A. class_available()
B. class_exists()
C. is_class_name()
D. is_class_exists()
3) … is triggred by calling isset() or empty() on inaccessible or non-existing properties.
A. _ _ set()
B. _ _ get()
C. _ _isset()
D. _ _isempty()
4) The …. function returns the name of the class to which the object belongs and returns FALSE if the object is not an object.
A. class_name()
B. get_class()
C. is_class_name()
D. get_class_exists()
5) The …. function returns an array containing all method names defined by the class_name.
A. class_name()
B. get_class()
C. get_class_name()
D. get_class_methods()
6) … is invoked when uset() is used on inaccessible or non-existing properties.
A. _ _ set()
B. _ _ get()
C. _ _isset()
D. _ _unset()
7) The …. function returns an associative array containing the names of all properties and their corresponding values defined within the class specified by class_name.
A. get_class_vars()
B. get_object_vars()
C. get_class_values()
D. get_object_vars()
8) The …. function returns an array containing the names of all classes defined within the currently executing script.
A. get_parent_classes()
B. get_object_classes()
C. get_declared_classes()
D. get_object_vars()
9) … is used to commit pending data or perform similar cleanup tasks.
A. _ _ commit()
B. _ _ sleep()
C. _ _cleanup()
D. _ _unset()
10) The …. function returns an associative containing the defined properties available to object and their corresponding values.
A. get_parent_class()
B. get_object_classes()
C. get_declared_classes()
D. get_object_vars()
11) The …. function returns the name of the parent of the class to which the object belongs.
A. get_parent_class()
B. get_object_classes()
C. get_declared_classes()
D. get_object_vars()
12) … is used to re-establish any database connections that may have been lost during serialization and perform other reinitialization tasks.
A. _ _ re_estiblish()
B. _ _ wake()
C. _ _wakeup()
D. _ _unset()
13) The …. function determines whether an interface exists, returning TRUE if it does, and FALSE otherwise.
A. class_exists()
B. interfase_exists()
C. exists()
D. method_exists()
14) The …. function returns TRUE if the object belongs to a class of type class_name or if it belongs to a class that is a child of class_name.
A. is_class()
B. is_object_belongs()
C. is_a()
D. is_a_class()
15) The … method allows a class to decide how it will react when it is treated as a string.
A. _ _ tostring()
B. _ _ string()
C. _ _decide()
D. _ _isstring()
16) The …. function returns TRUE if the object belongs to a class inherited from class_name and returns FALSE otherwise.
A. is_class()
B. is_class_of()
C. is_subclass_of()
D. is_class_inherited()
17) The …. function returns TRUE if a method named method_name is available to object and returns FALSE otherwise.
A. class_exists()
B. interfase_exists()
C. exists()
D. method_exists()
18) The … method is called when a script tries to call an object as a function.
A. _ _ set()
B. _ _ call()
C. _ _invoke()
D. _ _wakeup()
19) The function … can be used to retrieve a string with the name of the called class.
A. get_called_class()
B. called_class()
C. retrieve_class()
D. retrieve_called_class()
20) … returns a string containing a byte-stream representation of any value that can be stored in PHP.
A. unserialize()
B. serialize()
C. return_stream()
D. return_string()
Answers:
- D. class_alias()
- B. class_exists()
- C. _ _isset()
- B. get_class()
- D. get_class_methods()
- D. _ _unset()
- A. get_class_vars()
- C. get_declared_classes()
- B. _ _ sleep()
- D. get_object_vars()
- A. get_parent_class()
- C. _ _wakeup()
- B. interfase_exists()
- C. is_a()
- A. _ _ tostring()
- C. is_subclass_of()
- D. method_exists()
- C. _ _invoke()
- A. get_called_class()
- B. serialize()
Read Next: Top 20 MCQ Questions on Namespaces in PHP
Comments are closed.