Re: JsonSerializable New Interface method Proposal
| From: | Dean Eigenmann | Date: | Mon, 13 Jul 2015 18:56:56 +0000 |
| Subject: | Re: JsonSerializable New Interface method Proposal | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87155@lists.php.net to get a copy of this message | ||
I have updated the RFC with a new section showing the updates
Sent from my iPhone
> On 13 Jul 2015, at 20:47, Benjamin Eberlei <kontakt@beberlei.de> wrote:
>
> On Mon, Jul 13, 2015 at 3:22 PM, Dean Eigenmann <dean.eigenmann@icloud.com>
> wrote:
>
>> Ive just opened a new RFC
>> https://wiki.php.net/rfc/jsonserializable regarding
>> Json to Object unserialization.
>
> The approach with typecasting will not work, because the function
> json_decode doesn't have that information.
>
> Instead something like the JMS Serializer api is probably necessary: $user
> = json_decode($data, 'User');
>
> I agree with Guilherme that we need a second interface for this, especially
> because changing the existing one would be a BC break.