Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69273 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43622 invoked from network); 23 Sep 2013 14:49:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2013 14:49:23 -0000 Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.180 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.223.180 mail-ie0-f180.google.com Received: from [209.85.223.180] ([209.85.223.180:37427] helo=mail-ie0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/00-43439-2F450425 for ; Mon, 23 Sep 2013 10:49:22 -0400 Received: by mail-ie0-f180.google.com with SMTP id u16so6595372iet.39 for ; Mon, 23 Sep 2013 07:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VmBM0fmB8iGIUuRSjT+17XLkA4BpkOmPWU6YjsImU3Q=; b=O9XeNkvB2hjcj0L8uaCGFa/LuVpCwmBdF6KQ0qII7b6RjzirkNikU1cMJ2qxlCUyht tHC/bspmMNr00Jf1AFxpBeWIhpLUIDgt/ZE2rIfaBif8yVRqWjORMSXR0GtXCC973ooz jHbpqbFaTTvonG3f+bakqnw3Z/1OW27xK02c2rqZ7P4jqd80NTPtpdQ2iWnQc/YKA24t YXTbLWmkIAlpY4QJY2aN4f9fDS1mto6OfwuX1fETkUUcOix2YUTXgA4/DnCVMJRN+g0H DfCXF1hP09lnYMKSFzYe4L+fhQcGmF/TGfxOWHI5ITZpQHrYXM8wTDj7KS16bs8TufNp Hwsw== MIME-Version: 1.0 X-Received: by 10.42.82.84 with SMTP id c20mr117645icl.110.1379947316223; Mon, 23 Sep 2013 07:41:56 -0700 (PDT) Sender: jakub.php@gmail.com Received: by 10.64.6.162 with HTTP; Mon, 23 Sep 2013 07:41:55 -0700 (PDT) In-Reply-To: <52404AB9.2070007@php.net> References: <52404AB9.2070007@php.net> Date: Mon, 23 Sep 2013 15:41:55 +0100 X-Google-Sender-Auth: gEUx9RBKs2upsWG8rVE8HsZf2gU Message-ID: To: Joe Watkins Cc: PHP internals list , Lars Strojny Content-Type: multipart/alternative; boundary=90e6ba613ed297af0104e70e05bb Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: bukka@php.net (Jakub Zelenka) --90e6ba613ed297af0104e70e05bb Content-Type: text/plain; charset=ISO-8859-1 Hi, On Sep 23, 2013 at 3:05 PM, Joe Watkins wrote: > On 09/23/2013 02:43 PM, Lars Strojny wrote: > >> Hi Joe, >> >> what about serialization for those classes? >> >> cu, >> Lars >> >> > Same as any other object; what you are creating is normal classes without > a (declared) name, nothing about the objects functionality has differs from > an object of a named class. > I think that the question was: How would you figure out method implementation for unserialized object of anonymous class? Consider this example... $o = new class() { private $a = 1; public function test() { echo $this->a; } }; $o->test(); $str = serialize($o); $o2 = unserialize($str); $o2->test(); How would this work? Jakub --90e6ba613ed297af0104e70e05bb--