Programming Languages PHP Objective
Sep 23, 2025

Which method is used to implement custom serialization in PHP objects?

Choose the correct answer:
A) __serialize()
B) __sleep()
C) __wakeup()
D) Both A and B
Detailed Explanation

Explanation: PHP supports both __serialize()/__unserialize() (PHP 7.4+) and __sleep()/__wakeup() for custom serialization. The newer __serialize() method is preferred as it provides better control and performance.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback