Re: [PHP-DEV] What about a magic __toArray() method?

February 4, 2020 12:30 (Rowan Tommins)
On Tue, 4 Feb 2020 at 12:25, Tom Gerrits <> wrote:

> "(string) $var" doesn't seem a lot less explicit to me than > "$var->toString()" >
No, but it's significantly less explicit than "$var->getDebugString()" or "$var->formatHTML()" or "$var->getRawText()", all of which might exist on one class, and any of which might be chosen as the implementation for __toString() Regards, -- Rowan Tommins [IMSoP]