Hi Jaris:

> I don't know if I'm using json_encode for something it's not supposed to  
> do. I'm using it to serialize an object to send it to another  
> runtime-environment in response to an remote call, just like what I can  
> do with SOAP, REST or RMI. In this context I don't see much sense in  
> preventing protected/private data from being transfered.

So you are accessing the class from outside.  This is exactly the 
situation where private and protected should not be visible.  It's just 
like you're trying to access private properties from the wrong scope in 
PHP itself:

<?php
class c {
    private $p = 'hidden';
}

$o = new c;
echo $o->p;  // This will fail, as it should.

You need to change your architecture to do what you want.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

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

Reply via email to