2013/9/23 Kingsquare.nl - Robin Speekenbrink <ro...@kingsquare.nl>

> 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 <krak...@php.net>
>
> > 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

Reply via email to