I agree with you.
But when using json_encode I believe the developer wants to transfer the
complete object state, just like when using serialize.
Serialize does see private/protected class members, while json_encode not.
Javascript does not have class-accessors so why not convert
protected/private to public javascript attributes.
Stefan Walk wrote:
On Thursday 09 October 2008 15:13:43 Jarismar Chaves da Silva wrote:
Ok, nice solution, but I still don't see why json_encode ignores
protected/private class members. I mean, why we need this feature.
Because, in theory, it shouldn't even be able to see those members?
Regards,
Stefan
--
*Jarismar Chaves da Silva, M.Sc.*
*ADP**Labs** Brazil**
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
http://www.adp.com