Java has a transient keyword to skip serialising a property and I have a patch against 5.3 on http://whisky.macvicar.net/patches/

It might make it in to 5.4/6/next once I get some more free time.

Scott

On 1 Mar 2010, at 02:10, Jordi Boggiano <j.boggi...@seld.be> wrote:

On 01.03.2010 10:31, Tjerk Meesters wrote:
If visibility is an issue why not just use json_enode/decode for this
case then?it doesn't seem like a typical enough problem to be solved
low-level and json seems fast enough for the job ;-)

Honestly I personally don't care, it won't happen to me again, I know it
now, but I want it to be fixed for the benefit of others. Sure it's a
rare case, but if you're gonna pretend it's ok that objects have ghost
properties set to them that are unreadable, I guess there is no point in
discussing this further.

Should I btw remind you that the following results in a Fatal error:
Cannot redeclare Test::$foo ?

class Test {
protected $foo;
public $foo;
}

So it's illegal, but let's do it anyway because in php core it's funny
to do weird stuff that doesn't make any sense?

And in any case json_encode doesn't work the same at all since it
doesn't encode protected properties, and doesn't store the object type,
so it'd be much more work.

Cheers,
Jordi


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

Reply via email to