- Fixed wrong check for dynamic properties

This commit is contained in:
Felipe Pena 2008-08-11 13:35:49 +00:00
parent a37e9d2e0f
commit 7ea60b6f45
2 changed files with 9 additions and 5 deletions

View File

@ -509,9 +509,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
ulong index;
if ((prop_type = zend_hash_get_current_key_ex(properties, &prop_name, &prop_name_size, &index, 0, &pos)) == (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)) {
if (prop_name_size && (UG(unicode)?prop_name.u[0]:prop_name.s[0])) {
/* skip all private and protected properties */
if (zend_u_hash_exists(&ce->properties_info, prop_type, prop_name, prop_name_size)) {
if (prop_name_size && (UG(unicode)?prop_name.u[0]:prop_name.s[0])) { /* skip all private and protected properties */
if (!zend_u_hash_exists(&ce->properties_info, prop_type, prop_name, prop_name_size)) {
count++;
_property_string(&dyn, NULL, prop_name, sub_indent.string TSRMLS_CC);
}

View File

@ -9,7 +9,12 @@ class C1 {
protected $p2 = 2;
public $p3 = 3;
}
$obj = new ReflectionObject(new C1());
$x = new C1();
$x->z = 4;
$x->p3 = 5;
$obj = new ReflectionObject($x);
echo $obj;
?>
--EXPECTF--
@ -32,7 +37,7 @@ Object of class [ <user> class C1 ] {
}
- Dynamic properties [1] {
Property [ <dynamic> public $p3 ]
Property [ <dynamic> public $z ]
}
- Methods [0] {