mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17:26 +00:00
- Fixed wrong check for dynamic properties
This commit is contained in:
parent
a37e9d2e0f
commit
7ea60b6f45
@ -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);
|
||||
}
|
||||
|
@ -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] {
|
||||
|
Loading…
Reference in New Issue
Block a user