8. How can a class override the default serialization mechanism for its objects?


Вариант ответа 1 - A) By implementing the __shutdown and __startup methods

Вариант ответа 2 - B) By calling register_shutdown_function()

Вариант ответа 3 - C) By implementing __sleep() and __wakeup()

Вариант ответа 4 - D) The default serialization mechanism cannot be overridden

Вариант ответа 5 - E) By adding the class to the output buffering mechanism using ob_start()


Комментарий: __sleep() and __wakeup() can be used to customize the serialization process of an object. The correct answer, therefore, is C.

Комментарии

Имя пользователяТекст комментарияВведите код