Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67402 invoked from network); 23 Sep 2013 16:39:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2013 16:39:41 -0000 Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:39079] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/70-64778-ACE60425 for ; Mon, 23 Sep 2013 12:39:39 -0400 Received: by mail-ie0-f179.google.com with SMTP id e14so6960980iej.38 for ; Mon, 23 Sep 2013 09:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamharvey.name; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=l3pTsCqzX9Kfru3197Qu5Khyp5iZBSn00zfjxs9pGxI=; b=yHDoR2c17oiKjns9TWNmeKUDKDdDKpqrPxdAH4OS1/wOoyrAQp7MBvY6L+Qd4J7S7X AD82KVjBmSF/5vjZQiNlfBI/uBon6223AXa6NZ9C3bTvGFTKH6AcFW2ik1s4O+4gFfIV kICDTubprOt8vBkWXo18BVVEQVMVOCJ4j/Rd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=l3pTsCqzX9Kfru3197Qu5Khyp5iZBSn00zfjxs9pGxI=; b=RT5pD4XVI2i2G2iAO2MaZRLSbT/d6Qg+ucqASRofM5kNm85b9K4A6y81PtWjk1T4ol gCI6yWgJJIoBgeMKUj2iBpVusUkjFn4OpvQeQG3f7kquKU39S38pX7+PiutzZd57D7+I ZZM5leMKA9VZrAZGo8sEf4PL4MtkZ/BA1YRGaL1hL1EcmyqKDz6M4EkiDu6naVQCMAAX qzaNGl+SWYPGfH0fmyNW2IbBGAhaO9FijFjWxTyr0tElrHXP70ygLKpj6DDzSiGhIC1D dgpfpT80uo4Vk3sgeXNjxJQ5+Q03y4tDVH0d61JQ4SOEMiJIrp0a5hF5TgUXaVXdY6vx sU+Q== X-Gm-Message-State: ALoCoQmPF7deBzbOWa/3hQfsUwvmH6/QdULUmk1WPUjyRJakPHR9+ZNgJdzA3JbtqOoEEanO6h7Y X-Received: by 10.43.172.4 with SMTP id nw4mr6910809icc.25.1379954375826; Mon, 23 Sep 2013 09:39:35 -0700 (PDT) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.42.206.208 with HTTP; Mon, 23 Sep 2013 09:39:15 -0700 (PDT) In-Reply-To: <000901ceb86e$10be3fa0$323abee0$@net> References: <52404AB9.2070007@php.net> <000901ceb86e$10be3fa0$323abee0$@net> Date: Mon, 23 Sep 2013 09:39:15 -0700 X-Google-Sender-Auth: mZdj5LL2jd8gOhAuizcbkl2uaQ0 Message-ID: To: Chris Wright Cc: Joe Watkins , internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: aharvey@php.net (Adam Harvey) On 23 September 2013 08:03, Chris Wright wrote: > To summarize how I think this should be handled: Serialisation results in a > stdClass, unserialisation cannot be done because if you want it you're > already > Doing It WrongT. To me, serialising "successfully" would indicate that PHP could unserialise the object as it was. Since it can't, I'd prefer to just error out at the serialize() stage. As for the feature itself, I'm not really sold right now. The use cases I've seen for this previously in other languages have been situations where either a simple anonymous function or closure would suffice, or alternatively situations where you have a big anonymous class with lots of methods, and I think for the latter case I'd rather promote separating those sorts of implementations into standalone classes for readability reasons. Adam, who isn't even pretending that he's looked at the patch yet.