summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 862936d81c..e20479837b 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -324,6 +324,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
if (ce->num_interfaces) {
uint32_t i;
+ ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_UNRESOLVED_INTERFACES));
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
smart_str_append_printf(str, " extends %s", ZSTR_VAL(ce->interfaces[0]->name));
} else {
@@ -4336,7 +4337,7 @@ static int _adddynproperty(zval *ptr, int num_args, va_list args, zend_hash_key
zval *retval = va_arg(args, zval*);
/* under some circumstances, the properties hash table may contain numeric
- * properties (e.g. when casting from array). This is a WONT FIX bug, at
+ * properties (e.g. when casting from array). This is a WON'T FIX bug, at
* least for the moment. Ignore these */
if (hash_key->key == NULL) {
return 0;
@@ -4827,6 +4828,7 @@ ZEND_METHOD(reflection_class, getInterfaces)
if (ce->num_interfaces) {
uint32_t i;
+ ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_UNRESOLVED_INTERFACES));
array_init(return_value);
for (i=0; i < ce->num_interfaces; i++) {
zval interface;
@@ -4858,6 +4860,7 @@ ZEND_METHOD(reflection_class, getInterfaceNames)
return;
}
+ ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_UNRESOLVED_INTERFACES));
array_init(return_value);
for (i=0; i < ce->num_interfaces; i++) {
@@ -4888,8 +4891,13 @@ ZEND_METHOD(reflection_class, getTraits)
for (i=0; i < ce->num_traits; i++) {
zval trait;
- zend_reflection_class_factory(ce->traits[i], &trait);
- zend_hash_update(Z_ARRVAL_P(return_value), ce->traits[i]->name, &trait);
+ zend_class_entry *trait_ce;
+
+ trait_ce = zend_fetch_class_by_name(ce->trait_names[i].name,
+ ce->trait_names[i].lc_name, ZEND_FETCH_CLASS_TRAIT);
+ ZEND_ASSERT(trait_ce);
+ zend_reflection_class_factory(trait_ce, &trait);
+ zend_hash_update(Z_ARRVAL_P(return_value), ce->trait_names[i].name, &trait);
}
}
/* }}} */
@@ -4915,7 +4923,7 @@ ZEND_METHOD(reflection_class, getTraitNames)
array_init(return_value);
for (i=0; i < ce->num_traits; i++) {
- add_next_index_str(return_value, zend_string_copy(ce->traits[i]->name));
+ add_next_index_str(return_value, zend_string_copy(ce->trait_names[i].name));
}
}
/* }}} */