In a nutshell, __toArray()
would not be as useful when you have full control over the entire codebase.
But where __toArray()
would be extremely useful is in interfacing with existing code that expects
arrays and wants those arrays to be a specific format. Using classes and type-hinted methods allow to
encapsulate the intelligence into the class, and using __toArray()
makes for a nature use-case.