ZE2: print_r()/var_dump() and private/protected
| From: | Sebastian Bergmann | Date: | Mon, 02 Sep 2002 05:13:31 +0000 |
| Subject: | ZE2: print_r()/var_dump() and private/protected | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-87739@lists.php.net to get a copy of this message | ||
[I post this to php-dev@ since my mail to engine2@ didn't make it.]
[Is engine2@ down?]
It'd ease debugging of applications if print_r() and var_dump() would
show the proper name of private and protected members:
<?php
class Test {
private $test;
function __construct() {
$this->test = 'test';
}
}
$test = new Test;
print_r($test);
var_dump($test);
?>
Output:
test Object
(
[] => test
)
object(test)(1) {
[""]=>
string(4) "test"
}
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/