Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87153 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56561 invoked from network); 13 Jul 2015 18:47:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2015 18:47:11 -0000 Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 209.85.212.175 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:36778] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/2D-43998-AA704A55 for ; Mon, 13 Jul 2015 14:47:09 -0400 Received: by widjy10 with SMTP id jy10so78022128wid.1 for ; Mon, 13 Jul 2015 11:47:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=brPdDgIeRpqrpao84tOIO4GG8JL7r+GyMKDN3ZY+zZs=; b=ZqDssNGppODJovZRl7butFtrmWEZ9Nbs+jL/APDC+px4VvfSjkmsePq0/W3WnxH0de DvcMOKkoQE080jmXjzgobLxwnEp0HWJihMfaDA6vlefNWHnM5PHNqkofryCtWefeSI7J uT0HikgVmCUi4IjNFZdCxDzsFO4y4KWzC26ZEatXrUl9sjPq4mDJlJIUxqB+BiCHcbVU N/blhpDy1o4Hxi9+xL/4XoWoOgzD8kREA+CwKadNW+xe/p5jvBQ5Urys6fIjmQGZaA3Q 22ZGOFcNORUg9vxkZzxomDDL0uEKkLeTSn5SOHHco/QKz6O/T24BVLdmXl0T6Oox7xDo 00DA== X-Gm-Message-State: ALoCoQlRFO/LD52vV0Vw16YkTebVBLBdesbf11W2i1xTx/BlRapH53yEXwEZD0PbSmZILbBgrhVG MIME-Version: 1.0 X-Received: by 10.194.87.102 with SMTP id w6mr12436581wjz.111.1436813224520; Mon, 13 Jul 2015 11:47:04 -0700 (PDT) Received: by 10.194.90.208 with HTTP; Mon, 13 Jul 2015 11:47:04 -0700 (PDT) X-Originating-IP: [93.129.187.134] In-Reply-To: References: Date: Mon, 13 Jul 2015 20:47:04 +0200 Message-ID: To: Dean Eigenmann Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7bf19850db46a4051ac62502 Subject: Re: [PHP-DEV] JsonSerializable New Interface method Proposal From: kontakt@beberlei.de (Benjamin Eberlei) --047d7bf19850db46a4051ac62502 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 13, 2015 at 3:22 PM, Dean Eigenmann 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. --047d7bf19850db46a4051ac62502--