Php Objective Questions with Answers for written test exams 5

Question 5
When serializing and unserializing an object, which of the following precautions

should you keep in mind? (Choose two)

A. Always escape member properties that contain user input.

B. If the object contains resource variables, use magic functions to restore the

resources upon unserialization.

C. Use the magic functions to only save what is necessary.

D. Always use a transaction when saving the information to a database.

E. If the object contains resource variables, it cannot be serialized without first

destroying and releasing its resources.
Answers 5


Answers B and C are correct.Whenever you design an object that is meant to be

serialized or that can contain resource objects, you should implement the appropriate

magic functions to ensure that it is serialized and unserialized properly—and

using the smallest amount of information possible.

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---