Re: Re: Jsonable interface
| From: | Mathias Grimm | Date: | Tue, 18 May 2010 21:36:22 +0000 |
| Subject: | Re: Re: Jsonable interface | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48328@lists.php.net to get a copy of this message | ||
_json function to override properties and jsonIgore properties
when call json_encode($obMyClass) the __json and __jsonIgore will be called.
if a class is jsonable, this means that all properties will be encoded,
except properties on the ignore list
> This seems to be an attempt to solve a subset of the problem solved by
> JSONSerializable, but from a negation rather than a explicit orientation.
> What this doesn't provide, is the ability to serialize an object with
> modified or even completely different data from what is found in the base
> properties (something which may well be desired).
>
> This approach also has the very obvious added workload of introducing
> property traits (something I'm not against, but would require a great deal
> more discussion).
>
> Given that it does less at higher cost, I'm inclined to reply with "meh".
>
> -Sara
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Mathias Grimm
Sun Certified Java Programmer 6.0 #SUN604760
Zend Certified Engineer #ZEND006756
http://mathiasgrimm.com.br
http://phpempregos.com.br