Re: [RFC - discussion] __toArray()
| From: | Nikita Popov | Date: | Thu, 06 Feb 2020 12:05:51 +0000 |
| Subject: | Re: [RFC - discussion] __toArray() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108412@lists.php.net to get a copy of this message | ||
On Tue, Feb 4, 2020 at 2:03 PM Steven Wade <stevenwadejr@gmail.com> wrote:
> Hi all,
>
> I’d like to officially open my __toArray() RFC <
> https://wiki.php.net/rfc/to-array> up to discussion. I’ve
> delayed
> changing the status until I had more time to respond to the discussion, but
> since it’s been brought up again
> <https://externals.io/message/108351>, I
> figured now is the best time.
>
> https://wiki.php.net/rfc/to-array
> <https://wiki.php.net/rfc/to-array>
One of the things that stand out to me in this RFC is that once you set
strict_types=1 (which surely we all do :P), not a lot is left of it. While
there are quite a few places where objects can be implicitly converted to
strings (say echo, concatenation, etc), there are not a lot of places where
objects can be implicitly converted to array. A quick grep has around 500
string conversions in the codebase, and 20 array conversions.
Nikita