json_encode ignores protected/private class members
| From: | Jarismar Chaves da Silva | Date: | Thu, 09 Oct 2008 12:54:05 +0000 |
| Subject: | json_encode ignores protected/private class members | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-40885@lists.php.net to get a copy of this message | ||
Hi internals,
Does anyone knows why json_encode ignores protected/public class members ?
I've searching about it on documentation an mailing lists but found nothing but workarounds.
Until now I'm forced to change my classes to use public members when I need to send a PHP object on e.g. AJAX responses. It would be nice if json_encode also send those attributes or at least have a parameter to whether send non-public attributes or not.
Thanks in advance.
Jaris.
--
*Jarismar Chaves da Silva, M.Sc.*
*ADP**Labs** Brazil**
*jarismar_silva@adplabs.com.br <mailto:jarismar_silva@adplabs.com.br>
http://www.adp.com