Hi!

Add JSON_Serializable interface
Objects implementing JSON_Serializable will have
their ->jsonSerialize() method called

Similar to serialize() and __sleep()

Why should we have special mechanism for JSON? I.e., now we have one for serialize(), separate one for json, then we'd have separate one for storing object as XML or YAML, etc. etc. IMHO it's not a very good design - having separate method for every format of data storage. Why can't we just use whatever serialize() would see and wrap it in JSON after that?
--
Stanislav Malyshev, Zend Software Architect
s...@zend.com   http://www.zend.com/
(408)253-8829   MSN: s...@zend.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to