For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > January 2006 > print_r, var_dump and private properties in PHP5









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author print_r, var_dump and private properties in PHP5
Florian Anderiasch

2006-01-24, 6:57 pm

Hello there,
http://us3.php.net/manual/en/function.print-r.php states:
print_r() and var_export() will also show protected and private
properties of objects with PHP 5.


The German translation goes even a bit further and says:
print_r() und var_export() zeigen mit PHP 5 auch private und geschützte
Eigenschaften von Objekten an, im Gegensatz zur Funktion var_dump().
( last sentence =unlike the function var_dump())

http://us3.php.net/manual/de/function.print-r.php

Is this a documentation "bug" (as it implies that var_dump should not
put out all private properties) or is this a bug in var_dump()?

And is there then a method to dump only public properties in PHP5?

Greetings,
Florian
Mark Wiesemann

2006-01-24, 6:57 pm

Am 24. Januar 2006 schrieb Florian Anderiasch:

> http://us3.php.net/manual/en/function.print-r.php states:
> print_r() and var_export() will also show protected and private
> properties of objects with PHP 5.


http://cvs.php.net/viewcvs.cgi/phpd...-r.xml?view=log
see the comment to revision 1.10

> The German translation goes even a bit further ...


One could also says: The German translation is outdated. *g*

Regards,
Mark
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com