Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69297 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11727 invoked from network); 23 Sep 2013 20:16:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2013 20:16:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:37288] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/E0-07641-2B1A0425 for ; Mon, 23 Sep 2013 16:16:51 -0400 Received: by mail-wg0-f52.google.com with SMTP id m15so3591168wgh.31 for ; Mon, 23 Sep 2013 13:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=XUEtCSVzz/Qo3y5udutH0varWEWlobE3gaZuJnObZwk=; b=BzpsHG1xytOFZJ0dS8vfqsqNlnCtSsa4pNMzkBww70+MJoYy1+niP7InJJDbn+Y9AP pE0UktELwhlC6vp1dKKnE6rk2Uiojebg2R1Hx6GcSOiw6XutfNiyZxsDFZ6VXQ6YqzwI OIy475JCJ4Ycu+5NI1c7pRMUJv/KukeTjgGNYndg9r/uCaTS69fLmWBSxfg30zXVxori 3+6KOPn7fXP1/DD2PigrmtHzmbOpvj416IkPbPw7Gpi8YLbPaZzm3v7l1jJCCEYqy69w Hc8lP9N0h+iF/3tkAoJxVN+De3TWoYDgB6E/qmbKzsp6VAgixE8UhMeNL5M607EarmLo E3FQ== X-Received: by 10.180.20.163 with SMTP id o3mr15471006wie.1.1379967408115; Mon, 23 Sep 2013 13:16:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Mon, 23 Sep 2013 13:16:08 -0700 (PDT) In-Reply-To: References: <6D.71.03575.86970425@pb1.pair.com> Date: Mon, 23 Sep 2013 22:16:08 +0200 Message-ID: To: "Kingsquare.nl - Robin Speekenbrink" Cc: Joe Watkins , PHP internals Content-Type: multipart/alternative; boundary=bcaec53f30ed29979904e712b3a1 Subject: Re: [PHP-DEV] Re: RFC: Anonymous Classes From: krebs.seb@gmail.com (Sebastian Krebs) --bcaec53f30ed29979904e712b3a1 Content-Type: text/plain; charset=ISO-8859-1 2013/9/23 Kingsquare.nl - Robin Speekenbrink > Everyone, > > As a lurker i rarely have anthing to say, but this time i'd like to make an > exception: I see some usability for this type of usage, but would like to > disagree on the extra class... > My usage would be more in line with JSON way of passing around objects... > But i'd hate to see yet another new class type and kind of feel the > StdClass would've been more logical... > To me it sounds like you mix something up and describe a different use case (which is already easily possible) $stdClass = (object) [ 'foo' => 'bar' ]; The RFC is about anonymous objects _with_ behaviour (-> methods), whereas stdClass-objects doesn't have any methods. > The reasons for this imho is that the StdClass is the one-for-all object > without anything that's already there... (it's not like anonymous functions > are something different than regular functions?) > > As for actual need: personally i can easily live without, but then again: > we the influx of JSON-like notation / ubiquity this might make a logical > follow up.. ? > > Met vriendelijke groet, > > Robin Speekenbrink > Kingsquare BV > > > 2013/9/23 Joe Watkins > > > On 09/23/2013 07:39 AM, Joe Watkins wrote: > > > >> Morning All, > >> > >> https://wiki.php.net/rfc/**anonymous_classes< > https://wiki.php.net/rfc/anonymous_classes> > >> > >> I'd like to hear thoughts regarding the addition of anonymous > >> classes, patch included. > >> > >> Cheers > >> Joe > >> > > > > Serialization: > > > > As I have said, serialization does work, and unserialization does work > > ... > > > > Classes do have unique names, so as long as the entry is present upon > > unserialize you will get the object you expect ... if the entry is not > > present unserialization will fail silently. > > > > The same kind of thing can happen where you have declared a class based > > on some predicate, whose value has changed upon unserialize and so the > > entry is not present ... > > > > I'm not sure it is necessary to force any particular behaviour for > > serialization, it depends entirely on the application whether or not the > > entry is present upon serialization, it should be left down to the > > programmer. > > > > > > Cheers > > Joe > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- github.com/KingCrunch --bcaec53f30ed29979904e712b3a1--