Re: What about a magic __toArray() method?
| From: | Rowan Tommins | Date: | Tue, 04 Feb 2020 12:30:04 +0000 |
| Subject: | Re: What about a magic __toArray() method? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108364@lists.php.net to get a copy of this message | ||
On Tue, 4 Feb 2020 at 12:25, Tom Gerrits <tom@inventis.be> 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]