Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87148 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37240 invoked from network); 13 Jul 2015 15:03:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2015 15:03:47 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:36060] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/4A-43998-F43D3A55 for ; Mon, 13 Jul 2015 11:03:45 -0400 Received: by widjy10 with SMTP id jy10so72316421wid.1 for ; Mon, 13 Jul 2015 08:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yiuihpLG+bnEO1TmzFQF1W5MkoJOlhXb4VMFuWQjqlA=; b=uYXL6bOcLz6kBiUr+ifhWP9j1GgalUXtSB8r+S/qlOXWdtsCSdk8FDMtiW9iPvkguD P6F/F0OgIQFRKYKAuvI7uHe+qjL0xoNcInn+lrgLZm3dQnXpFS3TKekTweldTxaIFMQs NNcyqyvYCxnNbKrU58RQt3CbBpyWU3CFvs8uBdqTxxOdDE0cdOlbOtk3nFppRwv/HSdL x0BcsurXGTWiqrBHeOoUBnX5RjODVV5OhkVqXIkdenze/B5kTt841T2r0hBLTSyTjf80 9Y8ymIsR2j+T+c/JjTVv/7mKqqYmCwD9Pj5emWX2pFoaIaXZvFo3V+hTp35xMin5ZkvD iEUA== MIME-Version: 1.0 X-Received: by 10.194.89.5 with SMTP id bk5mr69728870wjb.144.1436799821050; Mon, 13 Jul 2015 08:03:41 -0700 (PDT) Received: by 10.28.188.70 with HTTP; Mon, 13 Jul 2015 08:03:40 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Jul 2015 09:03:40 -0600 Message-ID: To: Dean Eigenmann Cc: "guilhermeblanco@gmail.com" , sbj.ml.read@gmail.com, "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e010d8400f27761051ac30693 Subject: Re: [PHP-DEV] JsonSerializable New Interface method Proposal From: derokorian@gmail.com (Ryan Pallas) --089e010d8400f27761051ac30693 Content-Type: text/plain; charset=UTF-8 > > > Ive just opened a new RFC https://wiki.php.net/rfc/jsonserializable > > regarding Json to Object unserialization. > > I like the idea, but how do you handle complex json notations, that may contain arrays of objects? Say: { "id": 123 "type": "user", "name": "derokorian" "permissions": [{ "id": 1, "value": "create" },{ "id": 2, "value": "edit" }] } Would this new function give me objects of type Permission in the permissions array, or would this solution only be a single level deep and therefore return an array of StdClass? I see no way to be able to tell this to the decoder in the User class because php does not support typed arrays. --089e010d8400f27761051ac30693--