Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69536 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36940 invoked from network); 9 Oct 2013 12:29:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2013 12:29:35 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.220.178 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.220.178 mail-vc0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:64484] helo=mail-vc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/2B-06817-D2C45525 for ; Wed, 09 Oct 2013 08:29:34 -0400 Received: by mail-vc0-f178.google.com with SMTP id lh4so449612vcb.9 for ; Wed, 09 Oct 2013 05:29:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fxC2onpcTqkhoIWpuSwgzRR3ujDxqzSg/Db66WB7tMo=; b=bx3wtDGBPTUn82VurPMLTvIRApKrtRD0i9lJTYMoKOH1ZQ250bfyKm7c3mpuvrDfjj MtG9QG8rZC1l8uJV9GDkTg3UFBnpSFuDBv0lbi06U9U1JAcEvLNnRqIMpXR+x9T68f+Z 8IpzihqUlokWNWD1Om4kWJ25uLexhuDynBuSmyKH6iyjAbRNh/Dq/eUbKHwqc9fQkEHJ W7OVEYoulBN33/5lG0gt9UVT7deOhE88tFy74fCx1SwmN1GsynlKrugoaZzBP37UUvOM ygz3WM93U1TPTKUe/k2W8R741Sfr78rfPc7mu53z7euxkbvnDlF4YMdeolqqy+T29bov 4rmw== X-Gm-Message-State: ALoCoQnn7X/lBhDfPFLotayLY0gN5GTGo5JMlC01NVRWVJBvZKRqSm0bECEv1BVXa4lJowoOTItI MIME-Version: 1.0 X-Received: by 10.220.105.199 with SMTP id u7mr5358745vco.1.1381321770887; Wed, 09 Oct 2013 05:29:30 -0700 (PDT) Received: by 10.220.85.72 with HTTP; Wed, 9 Oct 2013 05:29:30 -0700 (PDT) X-Originating-IP: [149.254.250.160] Received: by 10.220.85.72 with HTTP; Wed, 9 Oct 2013 05:29:30 -0700 (PDT) In-Reply-To: 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 13:29:30 +0100 Message-ID: To: Ferenc Kovacs Cc: PHP internals , Joe Watkins Content-Type: multipart/alternative; boundary=047d7b343eca797d1004e84e098a Subject: Re: [PHP-DEV] Vote: Anonymous Classes From: pthreads@pthreads.org (Joe Watkins) --047d7b343eca797d1004e84e098a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Just quick note ... If you autoload a class which in turn unserializes an object of an anonymous class autoloading will not be invoked for the anonymous class ... It is compiled when you load the super / outer class ... Am out and about on phone ... I think these kinds of issues can be explained / resolved ... On 9 Oct 2013 13:18, "Ferenc Kovacs" wrote: > > 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 woul= d >>> 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 wher= e >> they are used ... so in fact there's nothing wrong with the vast majorit= y >> of applications using serialization of anonymous class objects. >> > > yeah, and you can't autoload that, and if you move the instanitation of a= n > 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 d= o > understand why is that, but it is not what most people would guess), whi= ch > 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 wa= y > 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; i= f >> the reason people are voting no is really that "we need to concentrate o= n >> 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 bi= n >> 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 appeali= ng, >> 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_ > > -- > Ferenc Kov=E1cs > @Tyr43l - http://tyrael.hu > --047d7b343eca797d1004e84e098a--