我有一个对象有一些受保护的属性,我想得到和设置。对象看起来像
Fields_Form_Element_Location Object
(
[helper] => formText
[_allowEmpty:protected] => 1
[_autoInsertNotEmptyValidator:protected] => 1
[_belongsTo:protected] =>
[_description:protected] =>
[_disableLoadDefaultDecorators:protected] =>
[_errorMessages:protected] => Array
(
)
[_errors:protected] => Array
(
)
[_isErrorForced:protected] =>
[_label:protected] => Current City
[_value:protected] => 93399
[class] => field_container field_19 option_1 parent_1
)
我想获取对象的value属性。当我尝试$ obj-> _value或$ obj->值时会产生错误。我搜索并找到使用PHP Reflection Class的解决方案。它在我的本地工作,但在服务器PHP版本是5.2.17所以我不能使用这个功能。那么任何解决方案如何获得这样的财产?