Lines Matching refs:ce
105 if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \
172 zend_class_entry *ce; member
190 static inline bool is_closure_invoke(zend_class_entry *ce, zend_string *lcname) { in is_closure_invoke() argument
191 return ce == zend_ce_closure in is_closure_invoke()
305 static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char *indent);
310 static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char *indent) in _class_string() argument
316 if (ce->type == ZEND_USER_CLASS && ce->info.user.doc_comment) { in _class_string()
317 smart_str_append_printf(str, "%s%s", indent, ZSTR_VAL(ce->info.user.doc_comment)); in _class_string()
325 if (ce->ce_flags & ZEND_ACC_INTERFACE) { in _class_string()
327 } else if (ce->ce_flags & ZEND_ACC_TRAIT) { in _class_string()
332 smart_str_append_printf(str, (ce->type == ZEND_USER_CLASS) ? "<user" : "<internal"); in _class_string()
333 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module) { in _class_string()
334 smart_str_append_printf(str, ":%s", ce->info.internal.module->name); in _class_string()
337 if (ce->get_iterator != NULL) { in _class_string()
340 if (ce->ce_flags & ZEND_ACC_INTERFACE) { in _class_string()
342 } else if (ce->ce_flags & ZEND_ACC_TRAIT) { in _class_string()
345 if (ce->ce_flags & (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { in _class_string()
348 if (ce->ce_flags & ZEND_ACC_FINAL) { in _class_string()
353 smart_str_append_printf(str, "%s", ZSTR_VAL(ce->name)); in _class_string()
354 if (ce->parent) { in _class_string()
355 smart_str_append_printf(str, " extends %s", ZSTR_VAL(ce->parent->name)); in _class_string()
358 if (ce->num_interfaces) { in _class_string()
361 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in _class_string()
362 if (ce->ce_flags & ZEND_ACC_INTERFACE) { in _class_string()
363 smart_str_append_printf(str, " extends %s", ZSTR_VAL(ce->interfaces[0]->name)); in _class_string()
365 smart_str_append_printf(str, " implements %s", ZSTR_VAL(ce->interfaces[0]->name)); in _class_string()
367 for (i = 1; i < ce->num_interfaces; ++i) { in _class_string()
368 smart_str_append_printf(str, ", %s", ZSTR_VAL(ce->interfaces[i]->name)); in _class_string()
374 if (ce->type == ZEND_USER_CLASS) { in _class_string()
375 smart_str_append_printf(str, "%s @@ %s %d-%d\n", indent, ZSTR_VAL(ce->info.user.filename), in _class_string()
376 ce->info.user.line_start, ce->info.user.line_end); in _class_string()
381 count = zend_hash_num_elements(&ce->constants_table); in _class_string()
387 ZEND_HASH_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), key, c) { in _class_string()
399 count = zend_hash_num_elements(&ce->properties_info); in _class_string()
403 ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop) { in _class_string()
404 if ((prop->flags & ZEND_ACC_PRIVATE) && prop->ce != ce) { in _class_string()
417 ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop) { in _class_string()
418 if ((prop->flags & ZEND_ACC_STATIC) && (!(prop->flags & ZEND_ACC_PRIVATE) || prop->ce == ce)) { in _class_string()
427 count = zend_hash_num_elements(&ce->function_table); in _class_string()
431 ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) { in _class_string()
433 && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) in _class_string()
445 ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) { in _class_string()
447 && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) in _class_string()
450 _function_string(str, mptr, ce, ZSTR_VAL(sub_indent)); in _class_string()
459 count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props; in _class_string()
464 ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop) { in _class_string()
466 && (!(prop->flags & ZEND_ACC_PRIVATE) || prop->ce == ce)) { in _class_string()
482 if (!zend_hash_exists(&ce->properties_info, prop_name)) { in _class_string()
497 count = zend_hash_num_elements(&ce->function_table) - count_static_funcs; in _class_string()
503 ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) { in _class_string()
505 && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) in _class_string()
509 if (obj && is_closure_invoke(ce, mptr->common.function_name) in _class_string()
517 _function_string(&method_str, mptr, ce, ZSTR_VAL(sub_indent)); in _class_string()
562 if (zval_update_constant_ex(&c->value, c->ce) == FAILURE) { in _class_const_string()
644 zend_class_entry *class = obj->ce; in format_default_value()
875 zend_class_entry *ce = prop_info->ce; in property_get_default() local
877 zval *prop = &ce->default_static_members_table[prop_info->offset]; in property_get_default()
881 return &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; in property_get_default()
967 static void _extension_class_string(zend_class_entry *ce, zend_string *key, smart_str *str, char *i… in _extension_class_string() argument
969 …if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module && !strcasecmp(ce->info.internal.m… in _extension_class_string()
971 if (zend_string_equals_ci(ce->name, key)) { in _extension_class_string()
973 _class_string(str, ce, NULL, indent); in _extension_class_string()
1085 zend_class_entry *ce; in _extension_string() local
1088 ZEND_HASH_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { in _extension_string()
1089 _extension_class_string(ce, key, &str_classes, ZSTR_VAL(sub_indent), module, &num_classes); in _extension_string()
1154 zend_class_entry *ce = zend_lookup_class_ex(attr->name, attr->lcname, 0); in read_attributes() local
1156 if (ce == NULL) { in read_attributes()
1165 if (!instanceof_function(ce, base)) { in read_attributes()
1254 PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object) in zend_reflection_class_factory() argument
1259 ce->ce_flags & ZEND_ACC_ENUM ? reflection_enum_ptr : reflection_class_ptr; in zend_reflection_class_factory()
1262 intern->ptr = ce; in zend_reflection_class_factory()
1264 intern->ce = ce; in zend_reflection_class_factory()
1265 ZVAL_STR_COPY(reflection_prop_name(object), ce->name); in zend_reflection_class_factory()
1289 intern->ce = NULL; in reflection_extension_factory()
1310 intern->ce = fptr->common.scope; in reflection_parameter_factory()
1407 intern->ce = NULL; in reflection_function_factory()
1416 static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *closure_ob… in reflection_method_factory() argument
1424 intern->ce = ce; in reflection_method_factory()
1435 static void reflection_property_factory(zend_class_entry *ce, zend_string *name, zend_property_info… in reflection_property_factory() argument
1447 intern->ce = ce; in reflection_property_factory()
1449 ZVAL_STR_COPY(reflection_prop_class(object), prop ? prop->ce->name : ce->name); in reflection_property_factory()
1453 static void reflection_property_factory_str(zend_class_entry *ce, const char *name_str, size_t name… in reflection_property_factory_str() argument
1456 reflection_property_factory(ce, name, prop, object); in reflection_property_factory_str()
1469 intern->ce = constant->ce; in reflection_class_constant_factory()
1472 ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name); in reflection_class_constant_factory()
1476 static void reflection_enum_case_factory(zend_class_entry *ce, zend_string *name_str, zend_class_co… in reflection_enum_case_factory() argument
1480 zend_class_entry *case_reflection_class = ce->backed_enum_table == IS_UNDEF in reflection_enum_case_factory()
1487 intern->ce = constant->ce; in reflection_enum_case_factory()
1490 ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name); in reflection_enum_case_factory()
1613 intern->ce = NULL; in ZEND_METHOD()
1628 _function_string(&str, fptr, intern->ce, ""); in ZEND_METHOD()
2229 if (intern->ce) { in ZEND_METHOD()
2235 intern->ce = zend_ce_generator; in ZEND_METHOD()
2388 zend_class_entry *ce = NULL; in ZEND_METHOD() local
2411 ce = fptr->common.scope; in ZEND_METHOD()
2428 ce = Z_OBJCE_P(classref); in ZEND_METHOD()
2434 if ((ce = zend_lookup_class(name)) == NULL) { in ZEND_METHOD()
2449 if (Z_TYPE_P(classref) == IS_OBJECT && is_closure_invoke(ce, lcname) in ZEND_METHOD()
2454 } else if ((fptr = zend_hash_find_ptr(&ce->function_table, lcname)) == NULL) { in ZEND_METHOD()
2456 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
2467 ce = Z_OBJCE_P(reference); in ZEND_METHOD()
2469 if (instanceof_function(ce, zend_ce_closure)) { in ZEND_METHOD()
2473 …} else if ((fptr = zend_hash_find_ptr(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE))) == … in ZEND_METHOD()
2475 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), ZEND_INVOKE_FUNC_NAME); in ZEND_METHOD()
2538 intern->ce = ce; in ZEND_METHOD()
2640 zend_class_entry *ce; in ZEND_METHOD() local
2665 ce = param->fptr->common.scope; in ZEND_METHOD()
2666 if (!ce) { in ZEND_METHOD()
2672 ce = param->fptr->common.scope; in ZEND_METHOD()
2673 if (!ce) { in ZEND_METHOD()
2678 if (!ce->parent) { in ZEND_METHOD()
2683 ce = ce->parent; in ZEND_METHOD()
2685 ce = zend_lookup_class(class_name); in ZEND_METHOD()
2686 if (!ce) { in ZEND_METHOD()
2692 zend_reflection_class_factory(ce, return_value); in ZEND_METHOD()
3177 zend_class_entry *ce = NULL; in ZEND_METHOD() local
3200 ce = arg1_obj->ce; in ZEND_METHOD()
3224 if ((ce = zend_lookup_class(class_name)) == NULL) { in ZEND_METHOD()
3240 if (ce == zend_ce_closure && orig_obj && (method_name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) in ZEND_METHOD()
3245 } else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, method_name_len)) == NULL) { in ZEND_METHOD()
3248 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), method_name); in ZEND_METHOD()
3257 intern->ce = ce; in ZEND_METHOD()
3272 _function_string(&str, mptr, intern->ce, ""); in ZEND_METHOD()
3385 fcc.called_scope = intern->ce; in reflection_method_invoke()
3634 …RETURN_BOOL((mptr->common.fn_flags & ZEND_ACC_CTOR) && intern->ce->constructor && intern->ce->cons… in ZEND_METHOD()
3700 …"Method %s::%s does not have a prototype", ZSTR_VAL(intern->ce->name), ZSTR_VAL(mptr->common.funct… in ZEND_METHOD()
3727 zend_class_entry *ce; in ZEND_METHOD() local
3736 ce = classname_obj->ce; in ZEND_METHOD()
3738 if ((ce = zend_lookup_class(classname_str)) == NULL) { in ZEND_METHOD()
3747 if ((constant = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), constname)) == NULL) { in ZEND_METHOD()
3748 …ex(reflection_exception_ptr, 0, "Constant %s::%s does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(con… in ZEND_METHOD()
3754 intern->ce = constant->ce; in ZEND_METHOD()
3756 ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name); in ZEND_METHOD()
3875 zval_update_constant_ex(&ref->value, ref->ce); in ZEND_METHOD()
3892 zend_reflection_class_factory(ref->ce, return_value); in ZEND_METHOD()
3922 ref->attributes, 0, ref->ce, ZEND_ATTRIBUTE_TARGET_CLASS_CONST, in ZEND_METHOD()
3923 ref->ce->type == ZEND_USER_CLASS ? ref->ce->info.user.filename : NULL); in ZEND_METHOD()
3944 zend_class_entry *ce; in reflection_class_object_ctor() local
3960 ZVAL_STR_COPY(reflection_prop_name(object), arg_obj->ce->name); in reflection_class_object_ctor()
3961 intern->ptr = arg_obj->ce; in reflection_class_object_ctor()
3966 if ((ce = zend_lookup_class(arg_class)) == NULL) { in reflection_class_object_ctor()
3973 ZVAL_STR_COPY(reflection_prop_name(object), ce->name); in reflection_class_object_ctor()
3974 intern->ptr = ce; in reflection_class_object_ctor()
3988 static void add_class_vars(zend_class_entry *ce, bool statics, zval *return_value) in add_class_vars() argument
3994 ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { in add_class_vars()
3996 prop_info->ce != ce)) { in add_class_vars()
4017 if (UNEXPECTED(zval_update_constant_ex(&prop_copy, ce) != SUCCESS)) { in add_class_vars()
4031 zend_class_entry *ce; in ZEND_METHOD() local
4040 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4042 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4046 if (ce->default_static_members_count && !CE_STATIC_MEMBERS(ce)) { in ZEND_METHOD()
4047 zend_class_init_statics(ce); in ZEND_METHOD()
4052 ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { in ZEND_METHOD()
4054 prop_info->ce != ce)) { in ZEND_METHOD()
4061 prop = &CE_STATIC_MEMBERS(ce)[prop_info->offset]; in ZEND_METHOD()
4081 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4089 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4091 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4096 EG(fake_scope) = ce; in ZEND_METHOD()
4097 prop = zend_std_get_static_property(ce, name, BP_VAR_IS); in ZEND_METHOD()
4109 "Property %s::$%s does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
4117 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4126 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4128 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4132 EG(fake_scope) = ce; in ZEND_METHOD()
4133 variable_ptr = zend_std_get_static_property_with_info(ce, name, BP_VAR_W, &prop_info); in ZEND_METHOD()
4138 "Class %s does not have a property named %s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
4165 zend_class_entry *ce; in ZEND_METHOD() local
4170 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4172 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4175 add_class_vars(ce, 1, return_value); in ZEND_METHOD()
4176 add_class_vars(ce, 0, return_value); in ZEND_METHOD()
4184 zend_class_entry *ce; in ZEND_METHOD() local
4190 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4191 _class_string(&str, ce, &intern->obj, ""); in ZEND_METHOD()
4200 zend_class_entry *ce; in ZEND_METHOD() local
4206 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4207 RETURN_STR_COPY(ce->name); in ZEND_METHOD()
4215 zend_class_entry *ce; in ZEND_METHOD() local
4220 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4221 RETURN_BOOL(ce->type == ZEND_INTERNAL_CLASS); in ZEND_METHOD()
4229 zend_class_entry *ce; in ZEND_METHOD() local
4234 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4235 RETURN_BOOL(ce->type == ZEND_USER_CLASS); in ZEND_METHOD()
4243 zend_class_entry *ce; in ZEND_METHOD() local
4248 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4249 RETURN_BOOL(ce->ce_flags & ZEND_ACC_ANON_CLASS); in ZEND_METHOD()
4257 zend_class_entry *ce; in ZEND_METHOD() local
4262 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4263 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
4264 RETURN_STR_COPY(ce->info.user.filename); in ZEND_METHOD()
4274 zend_class_entry *ce; in ZEND_METHOD() local
4279 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4280 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
4281 RETURN_LONG(ce->info.user.line_start); in ZEND_METHOD()
4291 zend_class_entry *ce; in ZEND_METHOD() local
4296 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4297 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
4298 RETURN_LONG(ce->info.user.line_end); in ZEND_METHOD()
4308 zend_class_entry *ce; in ZEND_METHOD() local
4313 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4314 if (ce->type == ZEND_USER_CLASS && ce->info.user.doc_comment) { in ZEND_METHOD()
4315 RETURN_STR_COPY(ce->info.user.doc_comment); in ZEND_METHOD()
4325 zend_class_entry *ce; in ZEND_METHOD() local
4327 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4330 ce->attributes, 0, ce, ZEND_ATTRIBUTE_TARGET_CLASS, in ZEND_METHOD()
4331 ce->type == ZEND_USER_CLASS ? ce->info.user.filename : NULL); in ZEND_METHOD()
4339 zend_class_entry *ce; in ZEND_METHOD() local
4344 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4346 if (ce->constructor) { in ZEND_METHOD()
4347 reflection_method_factory(ce, ce->constructor, NULL, return_value); in ZEND_METHOD()
4358 zend_class_entry *ce; in ZEND_METHOD() local
4365 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4367 RETVAL_BOOL(zend_hash_exists(&ce->function_table, lc_name) || is_closure_invoke(ce, lc_name)); in ZEND_METHOD()
4376 zend_class_entry *ce; in ZEND_METHOD() local
4385 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4387 if (!Z_ISUNDEF(intern->obj) && is_closure_invoke(ce, lc_name) in ZEND_METHOD()
4392 reflection_method_factory(ce, mptr, NULL, return_value); in ZEND_METHOD()
4393 } else if (Z_ISUNDEF(intern->obj) && is_closure_invoke(ce, lc_name) in ZEND_METHOD()
4394 …&& object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp… in ZEND_METHOD()
4397 reflection_method_factory(ce, mptr, NULL, return_value); in ZEND_METHOD()
4399 } else if ((mptr = zend_hash_find_ptr(&ce->function_table, lc_name)) != NULL) { in ZEND_METHOD()
4400 reflection_method_factory(ce, mptr, NULL, return_value); in ZEND_METHOD()
4403 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
4410 static bool _addmethod(zend_function *mptr, zend_class_entry *ce, HashTable *ht, zend_long filter) in _addmethod() argument
4412 if ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) && mptr->common.scope != ce) { in _addmethod()
4418 reflection_method_factory(ce, mptr, NULL, &method); in _addmethod()
4430 zend_class_entry *ce; in ZEND_METHOD() local
4443 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4446 ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) { in ZEND_METHOD()
4447 _addmethod(mptr, ce, Z_ARRVAL_P(return_value), filter); in ZEND_METHOD()
4450 if (instanceof_function(ce, zend_ce_closure)) { in ZEND_METHOD()
4455 object_init_ex(&obj_tmp, ce); in ZEND_METHOD()
4462 if (!_addmethod(closure, ce, Z_ARRVAL_P(return_value), filter)) { in ZEND_METHOD()
4478 zend_class_entry *ce; in ZEND_METHOD() local
4485 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4486 if ((property_info = zend_hash_find_ptr(&ce->properties_info, name)) != NULL) { in ZEND_METHOD()
4487 if ((property_info->flags & ZEND_ACC_PRIVATE) && property_info->ce != ce) { in ZEND_METHOD()
4506 zend_class_entry *ce, *ce2; in ZEND_METHOD() local
4516 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4517 if ((property_info = zend_hash_find_ptr(&ce->properties_info, name)) != NULL) { in ZEND_METHOD()
4518 if (!(property_info->flags & ZEND_ACC_PRIVATE) || property_info->ce == ce) { in ZEND_METHOD()
4519 reflection_property_factory(ce, name, property_info, return_value); in ZEND_METHOD()
4525 reflection_property_factory(ce, name, NULL, return_value); in ZEND_METHOD()
4548 if (!instanceof_function(ce, ce2)) { in ZEND_METHOD()
4549 …e %s::$%s does not specify a base class of %s", ZSTR_VAL(ce2->name), str_name, ZSTR_VAL(ce->name)); in ZEND_METHOD()
4552 ce = ce2; in ZEND_METHOD()
4554 property_info = zend_hash_str_find_ptr(&ce->properties_info, str_name, str_name_len); in ZEND_METHOD()
4557 || property_info->ce == ce)) { in ZEND_METHOD()
4558 reflection_property_factory_str(ce, str_name, str_name_len, property_info, return_value); in ZEND_METHOD()
4562 …n_ex(reflection_exception_ptr, 0, "Property %s::$%s does not exist", ZSTR_VAL(ce->name), str_name); in ZEND_METHOD()
4567 static void _addproperty(zend_property_info *pptr, zend_string *key, zend_class_entry *ce, HashTabl… in _addproperty() argument
4569 if ((pptr->flags & ZEND_ACC_PRIVATE) && pptr->ce != ce) { in _addproperty()
4575 reflection_property_factory(ce, key, pptr, &property); in _addproperty()
4582 static void _adddynproperty(zval *ptr, zend_string *key, zend_class_entry *ce, zval *retval) in _adddynproperty() argument
4598 reflection_property_factory(ce, key, NULL, &property); in _adddynproperty()
4607 zend_class_entry *ce; in ZEND_METHOD() local
4621 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4624 ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { in ZEND_METHOD()
4625 _addproperty(prop_info, key, ce, Z_ARRVAL_P(return_value), filter); in ZEND_METHOD()
4632 _adddynproperty(prop, key, ce, return_value); in ZEND_METHOD()
4642 zend_class_entry *ce; in ZEND_METHOD() local
4649 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4650 if (zend_hash_exists(&ce->constants_table, name)) { in ZEND_METHOD()
4662 zend_class_entry *ce; in ZEND_METHOD() local
4677 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4680 ZEND_HASH_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), key, constant) { in ZEND_METHOD()
4681 if (UNEXPECTED(zval_update_constant_ex(&constant->value, constant->ce) != SUCCESS)) { in ZEND_METHOD()
4697 zend_class_entry *ce; in ZEND_METHOD() local
4711 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4714 ZEND_HASH_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), name, constant) { in ZEND_METHOD()
4728 zend_class_entry *ce; in ZEND_METHOD() local
4737 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4738 constants_table = CE_CONSTANTS_TABLE(ce); in ZEND_METHOD()
4740 if (UNEXPECTED(zval_update_constant_ex(&c->value, c->ce) != SUCCESS)) { in ZEND_METHOD()
4755 zend_class_entry *ce; in ZEND_METHOD() local
4759 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4764 if ((constant = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), name)) == NULL) { in ZEND_METHOD()
4775 zend_class_entry *ce; in _class_check_flag() local
4780 GET_REFLECTION_OBJECT_PTR(ce); in _class_check_flag()
4781 RETVAL_BOOL(ce->ce_flags & mask); in _class_check_flag()
4789 zend_class_entry *ce; in ZEND_METHOD() local
4794 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4795 …if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_… in ZEND_METHOD()
4801 if (!ce->constructor) { in ZEND_METHOD()
4805 RETURN_BOOL(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC); in ZEND_METHOD()
4813 zend_class_entry *ce; in ZEND_METHOD() local
4819 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4820 …if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_… in ZEND_METHOD()
4824 if (ce->clone) { in ZEND_METHOD()
4825 RETURN_BOOL(ce->clone->common.fn_flags & ZEND_ACC_PUBLIC); in ZEND_METHOD()
4830 if (ce->clone) { in ZEND_METHOD()
4831 RETURN_BOOL(ce->clone->common.fn_flags & ZEND_ACC_PUBLIC); in ZEND_METHOD()
4833 if (UNEXPECTED(object_init_ex(&obj, ce) != SUCCESS)) { in ZEND_METHOD()
4882 zend_class_entry *ce; in ZEND_METHOD() local
4889 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4891 RETURN_LONG((ce->ce_flags & keep_flags)); in ZEND_METHOD()
4899 zend_class_entry *ce; in ZEND_METHOD() local
4905 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4906 RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce)); in ZEND_METHOD()
4914 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4917 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4919 if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { in ZEND_METHOD()
4924 EG(fake_scope) = ce; in ZEND_METHOD()
4935 …x(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ZSTR_VAL(ce->name)); in ZEND_METHOD()
4952 …%s does not have a constructor, so you cannot pass any constructor arguments", ZSTR_VAL(ce->name)); in ZEND_METHOD()
4961 zend_class_entry *ce; in ZEND_METHOD() local
4963 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4969 if (ce->type == ZEND_INTERNAL_CLASS in ZEND_METHOD()
4970 && ce->create_object != NULL && (ce->ce_flags & ZEND_ACC_FINAL)) { in ZEND_METHOD()
4971 …marked as final that cannot be instantiated without invoking its constructor", ZSTR_VAL(ce->name)); in ZEND_METHOD()
4975 object_init_ex(return_value, ce); in ZEND_METHOD()
4983 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4988 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4998 if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { in ZEND_METHOD()
5003 EG(fake_scope) = ce; in ZEND_METHOD()
5010 …x(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ZSTR_VAL(ce->name)); in ZEND_METHOD()
5022 …%s does not have a constructor, so you cannot pass any constructor arguments", ZSTR_VAL(ce->name)); in ZEND_METHOD()
5031 zend_class_entry *ce; in ZEND_METHOD() local
5036 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5038 if (ce->num_interfaces) { in ZEND_METHOD()
5041 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in ZEND_METHOD()
5043 for (i=0; i < ce->num_interfaces; i++) { in ZEND_METHOD()
5045 zend_reflection_class_factory(ce->interfaces[i], &interface); in ZEND_METHOD()
5046 zend_hash_update(Z_ARRVAL_P(return_value), ce->interfaces[i]->name, &interface); in ZEND_METHOD()
5058 zend_class_entry *ce; in ZEND_METHOD() local
5064 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5066 if (!ce->num_interfaces) { in ZEND_METHOD()
5071 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in ZEND_METHOD()
5074 for (i=0; i < ce->num_interfaces; i++) { in ZEND_METHOD()
5075 add_next_index_str(return_value, zend_string_copy(ce->interfaces[i]->name)); in ZEND_METHOD()
5084 zend_class_entry *ce; in ZEND_METHOD() local
5090 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5092 if (!ce->num_traits) { in ZEND_METHOD()
5098 for (i=0; i < ce->num_traits; i++) { in ZEND_METHOD()
5102 trait_ce = zend_fetch_class_by_name(ce->trait_names[i].name, in ZEND_METHOD()
5103 ce->trait_names[i].lc_name, ZEND_FETCH_CLASS_TRAIT); in ZEND_METHOD()
5106 zend_hash_update(Z_ARRVAL_P(return_value), ce->trait_names[i].name, &trait); in ZEND_METHOD()
5115 zend_class_entry *ce; in ZEND_METHOD() local
5121 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5123 if (!ce->num_traits) { in ZEND_METHOD()
5129 for (i=0; i < ce->num_traits; i++) { in ZEND_METHOD()
5130 add_next_index_str(return_value, zend_string_copy(ce->trait_names[i].name)); in ZEND_METHOD()
5139 zend_class_entry *ce; in ZEND_METHOD() local
5144 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5147 if (ce->trait_aliases) { in ZEND_METHOD()
5151 while (ce->trait_aliases[i]) { in ZEND_METHOD()
5153 zend_trait_method_reference *cur_ref = &ce->trait_aliases[i]->trait_method; in ZEND_METHOD()
5155 if (ce->trait_aliases[i]->alias) { in ZEND_METHOD()
5162 for (j = 0; j < ce->num_traits; j++) { in ZEND_METHOD()
5164 zend_hash_find_ptr(CG(class_table), ce->trait_names[j].lc_name); in ZEND_METHOD()
5177 …add_assoc_str_ex(return_value, ZSTR_VAL(ce->trait_aliases[i]->alias), ZSTR_LEN(ce->trait_aliases[i… in ZEND_METHOD()
5191 zend_class_entry *ce; in ZEND_METHOD() local
5196 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5198 if (ce->parent) { in ZEND_METHOD()
5199 zend_reflection_class_factory(ce->parent, return_value); in ZEND_METHOD()
5210 zend_class_entry *ce, *class_ce; in ZEND_METHOD() local
5233 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5235 RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce))); in ZEND_METHOD()
5244 zend_class_entry *ce, *interface_ce; in ZEND_METHOD() local
5271 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5273 RETURN_BOOL(instanceof_function(ce, interface_ce)); in ZEND_METHOD()
5281 zend_class_entry *ce; in ZEND_METHOD() local
5287 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5289 if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS | in ZEND_METHOD()
5294 RETURN_BOOL(ce->get_iterator || instanceof_function(ce, zend_ce_traversable)); in ZEND_METHOD()
5302 zend_class_entry *ce; in ZEND_METHOD() local
5308 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5310 if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module) { in ZEND_METHOD()
5311 reflection_extension_factory(return_value, ce->info.internal.module->name); in ZEND_METHOD()
5320 zend_class_entry *ce; in ZEND_METHOD() local
5326 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5328 if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module) { in ZEND_METHOD()
5329 RETURN_STRING(ce->info.internal.module->name); in ZEND_METHOD()
5340 zend_class_entry *ce; in ZEND_METHOD() local
5346 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5348 zend_string *name = ce->name; in ZEND_METHOD()
5358 zend_class_entry *ce; in ZEND_METHOD() local
5364 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5366 zend_string *name = ce->name; in ZEND_METHOD()
5379 zend_class_entry *ce; in ZEND_METHOD() local
5385 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5387 zend_string *name = ce->name; in ZEND_METHOD()
5412 zend_class_entry *ce; in ZEND_METHOD() local
5425 ce = classname_obj->ce; in ZEND_METHOD()
5427 if ((ce = zend_lookup_class(classname_str)) == NULL) { in ZEND_METHOD()
5433 property_info = zend_hash_find_ptr(&ce->properties_info, name); in ZEND_METHOD()
5436 && property_info->ce != ce)) { in ZEND_METHOD()
5444 …x(reflection_exception_ptr, 0, "Property %s::$%s does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(nam… in ZEND_METHOD()
5451 ZVAL_STR_COPY(reflection_prop_class(object), property_info->ce->name); in ZEND_METHOD()
5453 ZVAL_STR_COPY(reflection_prop_class(object), ce->name); in ZEND_METHOD()
5461 intern->ce = ce; in ZEND_METHOD()
5594 member_p = zend_read_static_property_ex(intern->ce, ref->unmangled_name, 0); in ZEND_METHOD()
5607 if (!instanceof_function(Z_OBJCE_P(object), ref->prop ? ref->prop->ce : intern->ce)) { in ZEND_METHOD()
5612 member_p = zend_read_property_ex(intern->ce, Z_OBJ_P(object), ref->unmangled_name, 0, &rv); in ZEND_METHOD()
5643 zend_update_static_property_ex(intern->ce, ref->unmangled_name, value); in ZEND_METHOD()
5649 zend_update_property_ex(intern->ce, Z_OBJ_P(object), ref->unmangled_name, value); in ZEND_METHOD()
5669 member_p = zend_read_static_property_ex(intern->ce, ref->unmangled_name, 1); in ZEND_METHOD()
5684 if (!instanceof_function(Z_OBJCE_P(object), ref->prop ? ref->prop->ce : intern->ce)) { in ZEND_METHOD()
5690 EG(fake_scope) = intern->ce; in ZEND_METHOD()
5704 zend_class_entry *ce; in ZEND_METHOD() local
5711 ce = ref->prop ? ref->prop->ce : intern->ce; in ZEND_METHOD()
5712 zend_reflection_class_factory(ce, return_value); in ZEND_METHOD()
5746 ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY, in ZEND_METHOD()
5747 ref->prop->ce->type == ZEND_USER_CLASS ? ref->prop->ce->info.user.filename : NULL); in ZEND_METHOD()
5855 if (UNEXPECTED(zval_update_constant_ex(return_value, prop_info->ce) != SUCCESS)) { in ZEND_METHOD()
5891 intern->ce = NULL; in ZEND_METHOD()
6028 static void add_extension_class(zend_class_entry *ce, zend_string *key, zval *class_array, zend_mod… in add_extension_class() argument
6030 …if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module && !strcasecmp(ce->info.internal.m… in add_extension_class()
6033 if (!zend_string_equals_ci(ce->name, key)) { in add_extension_class()
6038 name = ce->name; in add_extension_class()
6042 zend_reflection_class_factory(ce, &zclass); in add_extension_class()
6057 zend_class_entry *ce; in ZEND_METHOD() local
6065 ZEND_HASH_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { in ZEND_METHOD()
6066 add_extension_class(ce, key, return_value, module, 1); in ZEND_METHOD()
6077 zend_class_entry *ce; in ZEND_METHOD() local
6085 ZEND_HASH_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { in ZEND_METHOD()
6086 add_extension_class(ce, key, return_value, module, 0); in ZEND_METHOD()
6226 intern->ce = NULL; in ZEND_METHOD()
6562 zend_attribute *attr, zend_class_entry *ce, zend_object *obj, in call_attribute_constructor() argument
6565 zend_function *ctor = ce->constructor; in call_attribute_constructor()
6570 zend_throw_error(NULL, "Attribute constructor of class %s must be public", ZSTR_VAL(ce->name)); in call_attribute_constructor()
6609 zend_call_known_function(ctor, obj, obj->ce, NULL, argc, args, named_params); in call_attribute_constructor()
6654 zend_class_entry *ce; in ZEND_METHOD() local
6666 if (NULL == (ce = zend_lookup_class(attr->data->name))) { in ZEND_METHOD()
6671 if (NULL == (marker = zend_get_attribute_str(ce->attributes, ZEND_STRL("attribute")))) { in ZEND_METHOD()
6676 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
6682 if (FAILURE == zend_get_attribute_value(&tmp, marker, 0, ce)) { in ZEND_METHOD()
6711 if (SUCCESS != object_init_ex(&obj, ce)) { in ZEND_METHOD()
6737 if (ce->constructor) { in ZEND_METHOD()
6738 …if (FAILURE == call_attribute_constructor(attr->data, ce, Z_OBJ(obj), args, argc, named_params, at… in ZEND_METHOD()
6744 …NULL, "Attribute class %s does not have a constructor, cannot pass arguments", ZSTR_VAL(ce->name)); in ZEND_METHOD()
6761 zend_class_entry *ce; in ZEND_METHOD() local
6762 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
6764 if (!(ce->ce_flags & ZEND_ACC_ENUM)) { in ZEND_METHOD()
6765 …zend_throw_exception_ex(reflection_exception_ptr, -1, "Class \"%s\" is not an enum", ZSTR_VAL(ce->… in ZEND_METHOD()
6773 zend_class_entry *ce; in ZEND_METHOD() local
6780 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
6782 zend_class_constant *class_const = zend_hash_find_ptr(&ce->constants_table, name); in ZEND_METHOD()
6793 zend_class_entry *ce; in ZEND_METHOD() local
6800 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
6802 zend_class_constant *constant = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), name); in ZEND_METHOD()
6804 …zend_throw_exception_ex(reflection_exception_ptr, 0, "Case %s::%s does not exist", ZSTR_VAL(ce->na… in ZEND_METHOD()
6808 …zend_throw_exception_ex(reflection_exception_ptr, 0, "%s::%s is not a case", ZSTR_VAL(ce->name), Z… in ZEND_METHOD()
6812 reflection_enum_case_factory(ce, name, constant, return_value); in ZEND_METHOD()
6818 zend_class_entry *ce; in ZEND_METHOD() local
6826 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
6829 ZEND_HASH_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), name, constant) { in ZEND_METHOD()
6832 reflection_enum_case_factory(ce, name, constant, &class_const); in ZEND_METHOD()
6841 zend_class_entry *ce; in ZEND_METHOD() local
6847 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
6848 RETURN_BOOL(ce->enum_backing_type != IS_UNDEF); in ZEND_METHOD()
6854 zend_class_entry *ce; in ZEND_METHOD() local
6860 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
6862 if (ce->enum_backing_type == IS_UNDEF) { in ZEND_METHOD()
6865 zend_type type = ZEND_TYPE_INIT_CODE(ce->enum_backing_type, 0, 0); in ZEND_METHOD()
6884 …eflection_exception_ptr, 0, "Constant %s::%s is not a case", ZSTR_VAL(ref->ce->name), Z_STRVAL_P(c… in ZEND_METHOD()
6899 zend_reflection_class_factory(ref->ce, return_value); in ZEND_METHOD()
6914 if (ref->ce->enum_backing_type == IS_UNDEF) { in ZEND_METHOD()
6916 …n_exception_ptr, 0, "Enum case %s::%s is not a backed case", ZSTR_VAL(ref->ce->name), Z_STRVAL_P(c… in ZEND_METHOD()
6932 zval_update_constant_ex(&ref->value, ref->ce); in ZEND_METHOD()
6935 ZEND_ASSERT(intern->ce->enum_backing_type != IS_UNDEF); in ZEND_METHOD()
6954 if (intern->ce) { in ZEND_METHOD()
6960 intern->ce = zend_ce_fiber; in ZEND_METHOD()
7070 if (zend_hash_exists(&object->ce->properties_info, name) in _reflection_write_property()
7074 "Cannot set read-only property %s::$%s", ZSTR_VAL(object->ce->name), ZSTR_VAL(name)); in _reflection_write_property()