Re: protected/private access and var_dump/print_r
| From: | Marcus Boerger | Date: | Tue, 18 May 2004 08:06:51 +0000 |
| Subject: | Re: protected/private access and var_dump/print_r | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9929@lists.php.net to get a copy of this message | ||
Hello Andrey,
if we change something then we prevent all those function from showing
private and protected values. The current situation is ok for me though.
marcus
Tuesday, May 18, 2004, 10:01:12 AM, you wrote:
> Sara Golemon wrote:
>> var_dump($someobject); shows only public properties (as I'd expect), but
>> print_r($someobject) shows all properties (explicitly identifying
>> protected/private props).
>>
>> Am I wrong in thinking that's not right?
>>
>> -Sara
>>
> print_r relies on a engine's routine while var_dump() does not. I had a patch to enable
> var_dump do dump also the protected/private stuff (since I am var_dump() not a print_r()
> fan). AFAIR Andrei was pro for var_dump() being consistent with print_r().
>
> http://www.hristov.com/andrey/projects/php_stuff/patches/var_dump.diff
> The patch is from August last year. AFAIR it does what's expected :)
> Andrey
--
Best regards,
Marcus mailto:helly@php.net