Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34964 invoked from network); 9 Oct 2013 12:18:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2013 12:18:55 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.48 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.128.48 mail-qe0-f48.google.com Received: from [209.85.128.48] ([209.85.128.48:59359] helo=mail-qe0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/CA-06817-EA945525 for ; Wed, 09 Oct 2013 08:18:54 -0400 Received: by mail-qe0-f48.google.com with SMTP id d4so487461qej.35 for ; Wed, 09 Oct 2013 05:18:51 -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=i3MF6+1/0NffpanqE1oZhbOkP+QbVQAqM0tdhFA7vJ8=; b=0ksAfGwVf5Rh+0YFoBkHtWTmJW7GCbDv4e0UULMV3mw0do8IXWXD+Fq+UfFEEFPcQf /kaF7m+iJpW0dBR9eSye8kzG2nWr4QCnHmPZk6q0cUzrUP2j55RHjBoMQOHCDVjVMFS/ eQ2HYQzRD9Q1TAsyyoXpZPkDanLB4itqIx/gVXeDH7zJRCA2Xj1AA4HFNMBTXVtOXUPP f2MyJNjKG1GDC2g37mC1OwDr3/TAGbrjXfJBKunGlcNuEoWe736SwbFI6gscarBrEcmH f39t4R9SvOEdqejN8HWxFn71c+ivWfq6ZLuDe4v1JOP3UjQQPwI0ERQ75shVhdqXJIq5 f8Xg== MIME-Version: 1.0 X-Received: by 10.224.120.138 with SMTP id d10mr10448225qar.20.1381321130686; Wed, 09 Oct 2013 05:18:50 -0700 (PDT) Received: by 10.140.22.71 with HTTP; Wed, 9 Oct 2013 05:18:50 -0700 (PDT) In-Reply-To: <5255405D.4090402@php.net> References: <525283A7.50303@php.net> <83.12.24156.54982525@pb1.pair.com> <52550CB7.5040309@php.net> <5255405D.4090402@php.net> Date: Wed, 9 Oct 2013 14:18:50 +0200 Message-ID: To: Joe Watkins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c2eea050c1fd04e84de333 Subject: Re: [PHP-DEV] Vote: Anonymous Classes From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c2eea050c1fd04e84de333 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > I have voted no based on the lack of support for >> serialization/unserialization, and I think that we agreed that without >> somehow naming the class, we can't support that, and having a name would >> defeat the purpose of this feature. >> >> I'm looking forward to nested classes though. >> >> Tyrael, > > As mentioned in the RFC, there's nothing stopping you from > serializing an anonymous class. > Anonymous classes are named, they _have_ to be; they are named > after the codepath (so file/function/class) prefixed with namespace where > they are used ... so in fact there's nothing wrong with the vast majority > of applications using serialization of anonymous class objects. > yeah, and you can't autoload that, and if you move the instanitation of an anonymous class the generated internal classname will be different. and that is all fine for handling the instance in that specific request, but makes any attempt to persist and restore really fragile. I also think that anonymous classes and functions should be similar in this sense, and currently we don't allow the serialization of Closure instances(but we do allow the serialization of create_function(), and I do understand why is that, but it is not what most people would guess), which is a bit sucky, because you have to remember, that closures work the same way as any other callable, except that it can't be serialized (but it can be json_encoded and it will result in an empty object). I think that having such restrictions, when something almost works the way one would expect is wrong. > > Nested classes is more complicated than anonymous ones, if this > doesn't get in on a vote I don't see nested classes getting in either; if > the reason people are voting no is really that "we need to concentrate on > bugs", then what is really the point in preparing another RFC before 5.6 = is > out in the wild ... > anonymous classes and nested classes have a bit different usecases, hence supporter base, I think you shouldn't guess on the result for that based on the feedback on anonymous classes. > > I hear the syntax sugar thing ... but it's starting to wear a bin > thin, it's a phrase thrown around without much justification or thought: > Almost everything you add at the Zend level which requires some kind of > syntax (so, pretty much everything) can be described as syntactic sugar. = It > is only a parser modification, but that should only make it more appealin= g, > we aren't asking anything new of Zend ... > I didn't bring up this point, but I do agree that having changes in the ZE/parser should be done with a good reason, and simply because it could have a much wider impact area and less people familiar with fixing those kind of bugs. > > In any case, I appreciate the input :) > and we appreciate your work on improving php. _o_ --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c2eea050c1fd04e84de333--