Reply to How to get value of an private member?

Your name:

Reply:


Posted by Yarco on 09/12/07 06:30

For example:

<?php
class Test
{
private $name = 'yarco';
}

$p = new ReflectionPropery('Test', 'name');
print $p->getValue();

?>

This won't work. See: http://www.php.net/manual/en/language.oop5.reflection.php
==================
Note: Trying to get or set private or protected class property's
values will result in an exception being thrown.
==================
But when we use print_r or var_dump, we could see the private member.
Why reflection doesn't support this?
(We have friend class in c++.)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация