Hello, I would like to know why when I print_r or var_dump an object I
get the private properties. I give you an example:

<?php

class test
{
        private $myPrivate = 'topsecret';
}

$myTest = new test();

#echo $myTest->myPrivate; // Fatal error: Cannot access private property
test::$myPrivate in ..... that's OK!

echo '<pre>';
print_r($myTest);
#test Object
#(
#    [myPrivate:private] => topsecret
#)
var_dump($myTest);
#object(test)#1 (1) {
#  ["myPrivate:private"]=>
#  string(9) "topsecret"
#}
echo '</pre>';

?>

A private member is suposed to be private, isn't it?

Alex

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to