Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52021 invoked from network); 11 Dec 2013 15:39:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2013 15:39:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=chobieee@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chobieee@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.178 as permitted sender) X-PHP-List-Original-Sender: chobieee@gmail.com X-Host-Fingerprint: 209.85.192.178 mail-pd0-f178.google.com Received: from [209.85.192.178] ([209.85.192.178:55587] helo=mail-pd0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/B3-22966-83788A25 for ; Wed, 11 Dec 2013 10:39:37 -0500 Received: by mail-pd0-f178.google.com with SMTP id y10so9795299pdj.9 for ; Wed, 11 Dec 2013 07:39:34 -0800 (PST) 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=JAng3qhbd4D00M2s88p0N67QE3qnj1y19HEKfdzrdkA=; b=ff9WY2zEcsWXBshHzbsN87y3BG8C02pJEeIsoZvj1ylTqE8MBROKwvJE+ejOgvFMMI 5fSsMm1jtxmjIGpyd29bgB4D9RZp4DGb5A85erQnPe44N8lMwGRuejjmf6Rx5nIhT2TH OU/706oJfYaqG9z2H4GMLl27YSZVA4KZBpaTqClDKjjGKHQzoOv8OVRa3sVegwMqJCi0 8oVtPn1RqNj1GaIGnjzxMPcLgrGrpIzaqmv1Rm2oqRxG2f3tRMZQXqxj4VFOP/XkD9Xo EhmH0t2p9+iOJNizFf16byA5CZItSmy9ISmFqS6b0dB35O6U9pECrWpG+cYcISwV05I5 jArg== MIME-Version: 1.0 X-Received: by 10.68.111.33 with SMTP id if1mr2411033pbb.31.1386776374190; Wed, 11 Dec 2013 07:39:34 -0800 (PST) Received: by 10.68.1.231 with HTTP; Wed, 11 Dec 2013 07:39:34 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Dec 2013 00:39:34 +0900 Message-ID: To: Leigh Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Proposal: ArraySerializable interface From: chobieee@gmail.com (chobie) > I have no problems with the proposal in general, however did you see there > is an RFC already related to this > (https://wiki.php.net/rfc/object_cast_to_types) that has a patch you might > like to reference? Ah, I'm sorry. I didn't read the rfc and discussions when I sent email. that rfc and patch seems fine. but little bit big changes. > Not sure if this should come with an interface, for example __toString() > does not come with a StringSerializable interface. > > Perhaps __toArray() / __toString / __toWhatever should all be available > without an interface, but also have interfaces that wrap them for the sake > of typehinting (which means adding an interface for __toString) I agree your opinion. casting magic method shouldn't have interface. At this time. I referenced JsonSerialize but it's too much in this case.