Lines Matching refs:ce

116 		if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \
177 zend_class_entry *ce; member
195 static inline bool is_closure_invoke(const zend_class_entry *ce, const zend_string *lcname) { in is_closure_invoke() argument
196 return ce == zend_ce_closure in is_closure_invoke()
309 static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const char *indent);
314 static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const char *indent) in _class_string() argument
320 if (ce->doc_comment) { in _class_string()
321 smart_str_append_printf(str, "%s%s", indent, ZSTR_VAL(ce->doc_comment)); in _class_string()
329 if (ce->ce_flags & ZEND_ACC_INTERFACE) { in _class_string()
331 } else if (ce->ce_flags & ZEND_ACC_TRAIT) { in _class_string()
336 smart_str_append_printf(str, (ce->type == ZEND_USER_CLASS) ? "<user" : "<internal"); in _class_string()
337 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module) { in _class_string()
338 smart_str_append_printf(str, ":%s", ce->info.internal.module->name); in _class_string()
341 if (ce->get_iterator != NULL) { in _class_string()
344 if (ce->ce_flags & ZEND_ACC_INTERFACE) { in _class_string()
346 } else if (ce->ce_flags & ZEND_ACC_TRAIT) { in _class_string()
349 if (ce->ce_flags & (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { in _class_string()
352 if (ce->ce_flags & ZEND_ACC_FINAL) { in _class_string()
355 if (ce->ce_flags & ZEND_ACC_READONLY_CLASS) { in _class_string()
360 smart_str_append_printf(str, "%s", ZSTR_VAL(ce->name)); in _class_string()
361 if (ce->parent) { in _class_string()
362 smart_str_append_printf(str, " extends %s", ZSTR_VAL(ce->parent->name)); in _class_string()
365 if (ce->num_interfaces) { in _class_string()
368 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in _class_string()
369 if (ce->ce_flags & ZEND_ACC_INTERFACE) { in _class_string()
370 smart_str_append_printf(str, " extends %s", ZSTR_VAL(ce->interfaces[0]->name)); in _class_string()
372 smart_str_append_printf(str, " implements %s", ZSTR_VAL(ce->interfaces[0]->name)); in _class_string()
374 for (i = 1; i < ce->num_interfaces; ++i) { in _class_string()
375 smart_str_append_printf(str, ", %s", ZSTR_VAL(ce->interfaces[i]->name)); in _class_string()
381 if (ce->type == ZEND_USER_CLASS) { in _class_string()
382 smart_str_append_printf(str, "%s @@ %s %d-%d\n", indent, ZSTR_VAL(ce->info.user.filename), in _class_string()
383 ce->info.user.line_start, ce->info.user.line_end); in _class_string()
388 count = zend_hash_num_elements(&ce->constants_table); in _class_string()
394 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), key, c) { in _class_string()
406 count = zend_hash_num_elements(&ce->properties_info); in _class_string()
410 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop) { in _class_string()
411 if ((prop->flags & ZEND_ACC_PRIVATE) && prop->ce != ce) { in _class_string()
424 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop) { in _class_string()
425 if ((prop->flags & ZEND_ACC_STATIC) && (!(prop->flags & ZEND_ACC_PRIVATE) || prop->ce == ce)) { in _class_string()
434 count = zend_hash_num_elements(&ce->function_table); in _class_string()
438 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, mptr) { in _class_string()
440 && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) in _class_string()
452 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, mptr) { in _class_string()
454 && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) in _class_string()
457 _function_string(str, mptr, ce, ZSTR_VAL(sub_indent)); in _class_string()
466 count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props; in _class_string()
471 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop) { in _class_string()
473 && (!(prop->flags & ZEND_ACC_PRIVATE) || prop->ce == ce)) { in _class_string()
489 if (!zend_hash_exists(&ce->properties_info, prop_name)) { in _class_string()
504 count = zend_hash_num_elements(&ce->function_table) - count_static_funcs; in _class_string()
510 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, mptr) { in _class_string()
512 && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) in _class_string()
516 if (obj && is_closure_invoke(ce, mptr->common.function_name) in _class_string()
524 _function_string(&method_str, mptr, ce, ZSTR_VAL(sub_indent)); in _class_string()
597 if (Z_TYPE(c->value) == IS_CONSTANT_AST && zend_update_class_constant(c, name, c->ce) == FAILURE) { in _class_const_string()
913 zend_class_entry *ce = prop_info->ce; in property_get_default() local
915 zval *prop = &ce->default_static_members_table[prop_info->offset]; in property_get_default()
921 return &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; in property_get_default()
1021 static void _extension_class_string(zend_class_entry *ce, zend_string *key, smart_str *str, const c… in _extension_class_string() argument
1023 …if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module && !strcasecmp(ce->info.internal.m… in _extension_class_string()
1025 if (zend_string_equals_ci(ce->name, key)) { in _extension_class_string()
1027 _class_string(str, ce, NULL, indent); in _extension_class_string()
1139 zend_class_entry *ce; in _extension_string() local
1142 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { in _extension_string()
1143 _extension_class_string(ce, key, &str_classes, ZSTR_VAL(sub_indent), module, &num_classes); in _extension_string()
1209 zend_class_entry *ce = zend_lookup_class_ex(attr->name, attr->lcname, 0); in read_attributes() local
1211 if (ce == NULL) { in read_attributes()
1220 if (!instanceof_function(ce, base)) { in read_attributes()
1307 PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object) in zend_reflection_class_factory() argument
1312 ce->ce_flags & ZEND_ACC_ENUM ? reflection_enum_ptr : reflection_class_ptr; in zend_reflection_class_factory()
1315 intern->ptr = ce; in zend_reflection_class_factory()
1317 intern->ce = ce; in zend_reflection_class_factory()
1318 ZVAL_STR_COPY(reflection_prop_name(object), ce->name); in zend_reflection_class_factory()
1342 intern->ce = NULL; in reflection_extension_factory()
1363 intern->ce = fptr->common.scope; in reflection_parameter_factory()
1466 intern->ce = NULL; in reflection_function_factory()
1475 static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *closure_ob… in reflection_method_factory() argument
1483 intern->ce = ce; in reflection_method_factory()
1494 static void reflection_property_factory(zend_class_entry *ce, zend_string *name, zend_property_info… in reflection_property_factory() argument
1506 intern->ce = ce; in reflection_property_factory()
1508 ZVAL_STR_COPY(reflection_prop_class(object), prop ? prop->ce->name : ce->name); in reflection_property_factory()
1512 static void reflection_property_factory_str(zend_class_entry *ce, const char *name_str, size_t name… in reflection_property_factory_str() argument
1515 reflection_property_factory(ce, name, prop, object); in reflection_property_factory_str()
1528 intern->ce = constant->ce; in reflection_class_constant_factory()
1531 ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name); in reflection_class_constant_factory()
1535 static void reflection_enum_case_factory(zend_class_entry *ce, zend_string *name_str, zend_class_co… in reflection_enum_case_factory() argument
1539 zend_class_entry *case_reflection_class = ce->enum_backing_type == IS_UNDEF in reflection_enum_case_factory()
1546 intern->ce = constant->ce; in reflection_enum_case_factory()
1549 ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name); in reflection_enum_case_factory()
1675 intern->ce = NULL; in ZEND_METHOD()
1688 _function_string(&str, fptr, intern->ce, ""); in ZEND_METHOD()
2233 if (intern->ce) { in ZEND_METHOD()
2239 intern->ce = zend_ce_generator; in ZEND_METHOD()
2390 zend_class_entry *ce = NULL; in ZEND_METHOD() local
2413 ce = fptr->common.scope; in ZEND_METHOD()
2430 ce = Z_OBJCE_P(classref); in ZEND_METHOD()
2436 if ((ce = zend_lookup_class(name)) == NULL) { in ZEND_METHOD()
2451 if (Z_TYPE_P(classref) == IS_OBJECT && is_closure_invoke(ce, lcname) in ZEND_METHOD()
2456 } else if ((fptr = zend_hash_find_ptr(&ce->function_table, lcname)) == NULL) { in ZEND_METHOD()
2458 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
2469 ce = Z_OBJCE_P(reference); in ZEND_METHOD()
2471 if (instanceof_function(ce, zend_ce_closure)) { in ZEND_METHOD()
2475 …} else if ((fptr = zend_hash_find_ptr(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE))) == … in ZEND_METHOD()
2477 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), ZEND_INVOKE_FUNC_NAME); in ZEND_METHOD()
2540 intern->ce = ce; in ZEND_METHOD()
2634 zend_class_entry *ce; in ZEND_METHOD() local
2657 ce = param->fptr->common.scope; in ZEND_METHOD()
2658 if (!ce) { in ZEND_METHOD()
2664 ce = param->fptr->common.scope; in ZEND_METHOD()
2665 if (!ce) { in ZEND_METHOD()
2670 if (!ce->parent) { in ZEND_METHOD()
2675 ce = ce->parent; in ZEND_METHOD()
2677 ce = zend_lookup_class(class_name); in ZEND_METHOD()
2678 if (!ce) { in ZEND_METHOD()
2684 zend_reflection_class_factory(ce, return_value); in ZEND_METHOD()
3152 zend_class_entry *ce = NULL; in instantiate_reflection_method() local
3189 ce = arg1_obj->ce; in instantiate_reflection_method()
3213 if ((ce = zend_lookup_class(class_name)) == NULL) { in instantiate_reflection_method()
3227 …object_init_ex(return_value, execute_data->This.value.ce ? execute_data->This.value.ce : reflectio… in instantiate_reflection_method()
3234 if (ce == zend_ce_closure && orig_obj && (method_name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) in instantiate_reflection_method()
3239 } else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, method_name_len)) == NULL) { in instantiate_reflection_method()
3242 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), method_name); in instantiate_reflection_method()
3251 intern->ce = ce; in instantiate_reflection_method()
3273 _function_string(&str, mptr, intern->ce, ""); in ZEND_METHOD()
3376 …zend_call_known_function(callback, (object ? Z_OBJ_P(object) : NULL), intern->ce, &retval, argc, p… in reflection_method_invoke()
3608 …RETURN_BOOL((mptr->common.fn_flags & ZEND_ACC_CTOR) && intern->ce->constructor && intern->ce->cons… in ZEND_METHOD()
3679 …"Method %s::%s does not have a prototype", ZSTR_VAL(intern->ce->name), ZSTR_VAL(mptr->common.funct… in ZEND_METHOD()
3706 zend_class_entry *ce; in ZEND_METHOD() local
3715 ce = classname_obj->ce; in ZEND_METHOD()
3717 if ((ce = zend_lookup_class(classname_str)) == NULL) { in ZEND_METHOD()
3726 if ((constant = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), constname)) == NULL) { in ZEND_METHOD()
3727 …ex(reflection_exception_ptr, 0, "Constant %s::%s does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(con… in ZEND_METHOD()
3733 intern->ce = constant->ce; in ZEND_METHOD()
3735 ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name); in ZEND_METHOD()
3882 zend_result result = zend_update_class_constant(ref, Z_STR_P(name), ref->ce); in ZEND_METHOD()
3900 zend_reflection_class_factory(ref->ce, return_value); in ZEND_METHOD()
3928 ref->attributes, 0, ref->ce, ZEND_ATTRIBUTE_TARGET_CLASS_CONST, in ZEND_METHOD()
3929 ref->ce->type == ZEND_USER_CLASS ? ref->ce->info.user.filename : NULL); in ZEND_METHOD()
3962 zend_class_entry *ce; in reflection_class_object_ctor() local
3978 ZVAL_STR_COPY(reflection_prop_name(object), arg_obj->ce->name); in reflection_class_object_ctor()
3979 intern->ptr = arg_obj->ce; in reflection_class_object_ctor()
3984 if ((ce = zend_lookup_class(arg_class)) == NULL) { in reflection_class_object_ctor()
3991 ZVAL_STR_COPY(reflection_prop_name(object), ce->name); in reflection_class_object_ctor()
3992 intern->ptr = ce; in reflection_class_object_ctor()
4006 static void add_class_vars(zend_class_entry *ce, bool statics, zval *return_value) in add_class_vars() argument
4012 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { in add_class_vars()
4014 prop_info->ce != ce)) { in add_class_vars()
4035 if (UNEXPECTED(zval_update_constant_ex(&prop_copy, ce) != SUCCESS)) { in add_class_vars()
4049 zend_class_entry *ce; in ZEND_METHOD() local
4056 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4058 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4062 if (ce->default_static_members_count && !CE_STATIC_MEMBERS(ce)) { in ZEND_METHOD()
4063 zend_class_init_statics(ce); in ZEND_METHOD()
4068 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { in ZEND_METHOD()
4070 prop_info->ce != ce)) { in ZEND_METHOD()
4077 prop = &CE_STATIC_MEMBERS(ce)[prop_info->offset]; in ZEND_METHOD()
4097 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4105 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4107 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4112 EG(fake_scope) = ce; in ZEND_METHOD()
4113 prop = zend_std_get_static_property(ce, name, BP_VAR_IS); in ZEND_METHOD()
4125 "Property %s::$%s does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
4133 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4142 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4144 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4148 EG(fake_scope) = ce; in ZEND_METHOD()
4149 variable_ptr = zend_std_get_static_property_with_info(ce, name, BP_VAR_W, &prop_info); in ZEND_METHOD()
4154 "Class %s does not have a property named %s", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
4181 zend_class_entry *ce; in ZEND_METHOD() local
4184 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4186 if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { in ZEND_METHOD()
4189 add_class_vars(ce, 1, return_value); in ZEND_METHOD()
4190 add_class_vars(ce, 0, return_value); in ZEND_METHOD()
4198 zend_class_entry *ce; in ZEND_METHOD() local
4202 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4203 _class_string(&str, ce, &intern->obj, ""); in ZEND_METHOD()
4212 zend_class_entry *ce; in ZEND_METHOD() local
4216 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4217 RETURN_STR_COPY(ce->name); in ZEND_METHOD()
4225 zend_class_entry *ce; in ZEND_METHOD() local
4228 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4229 RETURN_BOOL(ce->type == ZEND_INTERNAL_CLASS); in ZEND_METHOD()
4237 zend_class_entry *ce; in ZEND_METHOD() local
4240 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4241 RETURN_BOOL(ce->type == ZEND_USER_CLASS); in ZEND_METHOD()
4249 zend_class_entry *ce; in ZEND_METHOD() local
4252 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4253 RETURN_BOOL(ce->ce_flags & ZEND_ACC_ANON_CLASS); in ZEND_METHOD()
4261 zend_class_entry *ce; in ZEND_METHOD() local
4264 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4265 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
4266 RETURN_STR_COPY(ce->info.user.filename); in ZEND_METHOD()
4276 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
4294 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4295 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
4296 RETURN_LONG(ce->info.user.line_end); in ZEND_METHOD()
4306 zend_class_entry *ce; in ZEND_METHOD() local
4309 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4310 if (ce->doc_comment) { in ZEND_METHOD()
4311 RETURN_STR_COPY(ce->doc_comment); in ZEND_METHOD()
4321 zend_class_entry *ce; in ZEND_METHOD() local
4323 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4326 ce->attributes, 0, ce, ZEND_ATTRIBUTE_TARGET_CLASS, in ZEND_METHOD()
4327 ce->type == ZEND_USER_CLASS ? ce->info.user.filename : NULL); in ZEND_METHOD()
4335 zend_class_entry *ce; in ZEND_METHOD() local
4338 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4340 if (ce->constructor) { in ZEND_METHOD()
4341 reflection_method_factory(ce, ce->constructor, NULL, return_value); in ZEND_METHOD()
4352 zend_class_entry *ce; in ZEND_METHOD() local
4359 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4361 RETVAL_BOOL(zend_hash_exists(&ce->function_table, lc_name) || is_closure_invoke(ce, lc_name)); in ZEND_METHOD()
4370 zend_class_entry *ce; in ZEND_METHOD() local
4379 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4381 if (!Z_ISUNDEF(intern->obj) && is_closure_invoke(ce, lc_name) in ZEND_METHOD()
4386 reflection_method_factory(ce, mptr, NULL, return_value); in ZEND_METHOD()
4387 } else if (Z_ISUNDEF(intern->obj) && is_closure_invoke(ce, lc_name) in ZEND_METHOD()
4388 …&& object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp… in ZEND_METHOD()
4391 reflection_method_factory(ce, mptr, NULL, return_value); in ZEND_METHOD()
4393 } else if ((mptr = zend_hash_find_ptr(&ce->function_table, lc_name)) != NULL) { in ZEND_METHOD()
4394 reflection_method_factory(ce, mptr, NULL, return_value); in ZEND_METHOD()
4397 "Method %s::%s() does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(name)); in ZEND_METHOD()
4404 static bool _addmethod(zend_function *mptr, zend_class_entry *ce, HashTable *ht, zend_long filter) in _addmethod() argument
4406 if ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) && mptr->common.scope != ce) { in _addmethod()
4412 reflection_method_factory(ce, mptr, NULL, &method); in _addmethod()
4424 zend_class_entry *ce; in ZEND_METHOD() local
4437 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4440 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, mptr) { in ZEND_METHOD()
4441 _addmethod(mptr, ce, Z_ARRVAL_P(return_value), filter); in ZEND_METHOD()
4444 if (instanceof_function(ce, zend_ce_closure)) { in ZEND_METHOD()
4449 object_init_ex(&obj_tmp, ce); in ZEND_METHOD()
4456 if (!_addmethod(closure, ce, Z_ARRVAL_P(return_value), filter)) { in ZEND_METHOD()
4472 zend_class_entry *ce; in ZEND_METHOD() local
4479 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4480 if ((property_info = zend_hash_find_ptr(&ce->properties_info, name)) != NULL) { in ZEND_METHOD()
4481 if ((property_info->flags & ZEND_ACC_PRIVATE) && property_info->ce != ce) { in ZEND_METHOD()
4500 zend_class_entry *ce, *ce2; in ZEND_METHOD() local
4510 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4511 if ((property_info = zend_hash_find_ptr(&ce->properties_info, name)) != NULL) { in ZEND_METHOD()
4512 if (!(property_info->flags & ZEND_ACC_PRIVATE) || property_info->ce == ce) { in ZEND_METHOD()
4513 reflection_property_factory(ce, name, property_info, return_value); in ZEND_METHOD()
4519 reflection_property_factory(ce, name, NULL, return_value); in ZEND_METHOD()
4542 if (!instanceof_function(ce, ce2)) { in ZEND_METHOD()
4543 …e %s::$%s does not specify a base class of %s", ZSTR_VAL(ce2->name), str_name, ZSTR_VAL(ce->name)); in ZEND_METHOD()
4546 ce = ce2; in ZEND_METHOD()
4548 property_info = zend_hash_str_find_ptr(&ce->properties_info, str_name, str_name_len); in ZEND_METHOD()
4551 || property_info->ce == ce)) { in ZEND_METHOD()
4552 reflection_property_factory_str(ce, str_name, str_name_len, property_info, return_value); in ZEND_METHOD()
4556 …n_ex(reflection_exception_ptr, 0, "Property %s::$%s does not exist", ZSTR_VAL(ce->name), str_name); in ZEND_METHOD()
4561 static void _addproperty(zend_property_info *pptr, zend_string *key, zend_class_entry *ce, HashTabl… in _addproperty() argument
4563 if ((pptr->flags & ZEND_ACC_PRIVATE) && pptr->ce != ce) { in _addproperty()
4569 reflection_property_factory(ce, key, pptr, &property); in _addproperty()
4576 static void _adddynproperty(zval *ptr, zend_string *key, zend_class_entry *ce, zval *retval) in _adddynproperty() argument
4592 reflection_property_factory(ce, key, NULL, &property); in _adddynproperty()
4601 zend_class_entry *ce; in ZEND_METHOD() local
4615 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4618 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { in ZEND_METHOD()
4619 _addproperty(prop_info, key, ce, Z_ARRVAL_P(return_value), filter); in ZEND_METHOD()
4626 _adddynproperty(prop, key, ce, return_value); in ZEND_METHOD()
4636 zend_class_entry *ce; in ZEND_METHOD() local
4643 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4644 if (zend_hash_exists(&ce->constants_table, name)) { in ZEND_METHOD()
4656 zend_class_entry *ce; in ZEND_METHOD() local
4671 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4674 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), key, constant) { in ZEND_METHOD()
4675 …value) == IS_CONSTANT_AST && zend_update_class_constant(constant, key, constant->ce) != SUCCESS)) { in ZEND_METHOD()
4691 zend_class_entry *ce; in ZEND_METHOD() local
4705 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4708 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), name, constant) { in ZEND_METHOD()
4722 zend_class_entry *ce; in ZEND_METHOD() local
4731 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4732 constants_table = CE_CONSTANTS_TABLE(ce); in ZEND_METHOD()
4734 …if (UNEXPECTED(Z_TYPE(c->value) == IS_CONSTANT_AST && zend_update_class_constant(c, key, c->ce) !=… in ZEND_METHOD()
4749 zend_class_entry *ce; in ZEND_METHOD() local
4753 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4758 if ((constant = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), name)) == NULL) { in ZEND_METHOD()
4769 zend_class_entry *ce; in _class_check_flag() local
4772 GET_REFLECTION_OBJECT_PTR(ce); in _class_check_flag()
4773 RETVAL_BOOL(ce->ce_flags & mask); in _class_check_flag()
4781 zend_class_entry *ce; in ZEND_METHOD() local
4784 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4785 …if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_… in ZEND_METHOD()
4791 if (!ce->constructor) { in ZEND_METHOD()
4795 RETURN_BOOL(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC); in ZEND_METHOD()
4803 zend_class_entry *ce; in ZEND_METHOD() local
4807 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4808 …if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_… in ZEND_METHOD()
4812 if (ce->clone) { in ZEND_METHOD()
4813 RETURN_BOOL(ce->clone->common.fn_flags & ZEND_ACC_PUBLIC); in ZEND_METHOD()
4818 if (ce->clone) { in ZEND_METHOD()
4819 RETURN_BOOL(ce->clone->common.fn_flags & ZEND_ACC_PUBLIC); in ZEND_METHOD()
4821 if (UNEXPECTED(object_init_ex(&obj, ce) != SUCCESS)) { in ZEND_METHOD()
4876 zend_class_entry *ce; in ZEND_METHOD() local
4880 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4882 RETURN_LONG((ce->ce_flags & keep_flags)); in ZEND_METHOD()
4890 zend_class_entry *ce; in ZEND_METHOD() local
4896 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4897 RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce)); in ZEND_METHOD()
4905 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4908 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4910 if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { in ZEND_METHOD()
4915 EG(fake_scope) = ce; in ZEND_METHOD()
4926 …x(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ZSTR_VAL(ce->name)); in ZEND_METHOD()
4943 …%s does not have a constructor, so you cannot pass any constructor arguments", ZSTR_VAL(ce->name)); in ZEND_METHOD()
4952 zend_class_entry *ce; in ZEND_METHOD() local
4954 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4958 if (ce->type == ZEND_INTERNAL_CLASS in ZEND_METHOD()
4959 && ce->create_object != NULL && (ce->ce_flags & ZEND_ACC_FINAL)) { in ZEND_METHOD()
4960 …marked as final that cannot be instantiated without invoking its constructor", ZSTR_VAL(ce->name)); in ZEND_METHOD()
4964 object_init_ex(return_value, ce); in ZEND_METHOD()
4972 zend_class_entry *ce, *old_scope; in ZEND_METHOD() local
4977 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
4987 if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { in ZEND_METHOD()
4992 EG(fake_scope) = ce; in ZEND_METHOD()
4999 …x(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ZSTR_VAL(ce->name)); in ZEND_METHOD()
5011 …%s does not have a constructor, so you cannot pass any constructor arguments", ZSTR_VAL(ce->name)); in ZEND_METHOD()
5021 zend_class_entry *ce; in reflection_class_new_lazy() local
5029 GET_REFLECTION_OBJECT_PTR(ce); in reflection_class_new_lazy()
5033 Z_PARAM_OBJ_OF_CLASS(obj, ce) in reflection_class_new_lazy()
5076 obj = zend_object_make_lazy(obj, ce, &fci.function_name, &fcc, in reflection_class_new_lazy()
5124 zend_class_entry *ce; in ZEND_METHOD() local
5127 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5130 Z_PARAM_OBJ_OF_CLASS(object, ce) in ZEND_METHOD()
5141 zend_class_entry *ce; in ZEND_METHOD() local
5144 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5147 Z_PARAM_OBJ_OF_CLASS(object, ce) in ZEND_METHOD()
5167 zend_class_entry *ce; in ZEND_METHOD() local
5170 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5173 Z_PARAM_OBJ_OF_CLASS(object, ce) in ZEND_METHOD()
5193 zend_class_entry *ce; in ZEND_METHOD() local
5196 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5199 Z_PARAM_OBJ_OF_CLASS(object, ce) in ZEND_METHOD()
5215 zend_class_entry *ce; in ZEND_METHOD() local
5218 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5220 if (ce->num_interfaces) { in ZEND_METHOD()
5223 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in ZEND_METHOD()
5225 for (i=0; i < ce->num_interfaces; i++) { in ZEND_METHOD()
5227 zend_reflection_class_factory(ce->interfaces[i], &interface); in ZEND_METHOD()
5228 zend_hash_update(Z_ARRVAL_P(return_value), ce->interfaces[i]->name, &interface); in ZEND_METHOD()
5240 zend_class_entry *ce; in ZEND_METHOD() local
5244 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5246 if (!ce->num_interfaces) { in ZEND_METHOD()
5251 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in ZEND_METHOD()
5254 for (i=0; i < ce->num_interfaces; i++) { in ZEND_METHOD()
5255 add_next_index_str(return_value, zend_string_copy(ce->interfaces[i]->name)); in ZEND_METHOD()
5264 zend_class_entry *ce; in ZEND_METHOD() local
5268 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5270 if (!ce->num_traits) { in ZEND_METHOD()
5276 for (i=0; i < ce->num_traits; i++) { in ZEND_METHOD()
5280 trait_ce = zend_fetch_class_by_name(ce->trait_names[i].name, in ZEND_METHOD()
5281 ce->trait_names[i].lc_name, ZEND_FETCH_CLASS_TRAIT); in ZEND_METHOD()
5284 zend_hash_update(Z_ARRVAL_P(return_value), ce->trait_names[i].name, &trait); in ZEND_METHOD()
5293 zend_class_entry *ce; in ZEND_METHOD() local
5297 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5299 if (!ce->num_traits) { in ZEND_METHOD()
5305 for (i=0; i < ce->num_traits; i++) { in ZEND_METHOD()
5306 add_next_index_str(return_value, zend_string_copy(ce->trait_names[i].name)); in ZEND_METHOD()
5315 zend_class_entry *ce; in ZEND_METHOD() local
5318 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5321 if (ce->trait_aliases) { in ZEND_METHOD()
5325 while (ce->trait_aliases[i]) { in ZEND_METHOD()
5327 zend_trait_method_reference *cur_ref = &ce->trait_aliases[i]->trait_method; in ZEND_METHOD()
5329 if (ce->trait_aliases[i]->alias) { in ZEND_METHOD()
5336 for (j = 0; j < ce->num_traits; j++) { in ZEND_METHOD()
5338 zend_hash_find_ptr(CG(class_table), ce->trait_names[j].lc_name); in ZEND_METHOD()
5351 …add_assoc_str_ex(return_value, ZSTR_VAL(ce->trait_aliases[i]->alias), ZSTR_LEN(ce->trait_aliases[i… in ZEND_METHOD()
5365 zend_class_entry *ce; in ZEND_METHOD() local
5368 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5370 if (ce->parent) { in ZEND_METHOD()
5371 zend_reflection_class_factory(ce->parent, return_value); in ZEND_METHOD()
5382 zend_class_entry *ce, *class_ce; in ZEND_METHOD() local
5405 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5407 RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce))); in ZEND_METHOD()
5416 zend_class_entry *ce, *interface_ce; in ZEND_METHOD() local
5443 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5445 RETURN_BOOL(instanceof_function(ce, interface_ce)); in ZEND_METHOD()
5453 zend_class_entry *ce; in ZEND_METHOD() local
5457 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5459 if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS | in ZEND_METHOD()
5464 RETURN_BOOL(ce->get_iterator || instanceof_function(ce, zend_ce_traversable)); in ZEND_METHOD()
5472 zend_class_entry *ce; in ZEND_METHOD() local
5476 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5478 if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module) { in ZEND_METHOD()
5479 reflection_extension_factory(return_value, ce->info.internal.module->name); in ZEND_METHOD()
5488 zend_class_entry *ce; in ZEND_METHOD() local
5492 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5494 if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module) { in ZEND_METHOD()
5495 RETURN_STRING(ce->info.internal.module->name); in ZEND_METHOD()
5506 zend_class_entry *ce; in ZEND_METHOD() local
5510 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5512 zend_string *name = ce->name; in ZEND_METHOD()
5522 zend_class_entry *ce; in ZEND_METHOD() local
5526 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5528 zend_string *name = ce->name; in ZEND_METHOD()
5541 zend_class_entry *ce; in ZEND_METHOD() local
5545 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
5547 zend_string *name = ce->name; in ZEND_METHOD()
5572 zend_class_entry *ce; in ZEND_METHOD() local
5585 ce = classname_obj->ce; in ZEND_METHOD()
5587 if ((ce = zend_lookup_class(classname_str)) == NULL) { in ZEND_METHOD()
5593 property_info = zend_hash_find_ptr(&ce->properties_info, name); in ZEND_METHOD()
5596 && property_info->ce != ce)) { in ZEND_METHOD()
5604 …x(reflection_exception_ptr, 0, "Property %s::$%s does not exist", ZSTR_VAL(ce->name), ZSTR_VAL(nam… in ZEND_METHOD()
5611 ZVAL_STR_COPY(reflection_prop_class(object), property_info->ce->name); in ZEND_METHOD()
5613 ZVAL_STR_COPY(reflection_prop_class(object), ce->name); in ZEND_METHOD()
5621 intern->ce = ce; in ZEND_METHOD()
5777 member_p = zend_read_static_property_ex(intern->ce, ref->unmangled_name, 0); in ZEND_METHOD()
5790 if (!instanceof_function(Z_OBJCE_P(object), ref->prop ? ref->prop->ce : intern->ce)) { in ZEND_METHOD()
5795 member_p = zend_read_property_ex(intern->ce, Z_OBJ_P(object), ref->unmangled_name, 0, &rv); in ZEND_METHOD()
5841 zend_update_static_property_ex(intern->ce, ref->unmangled_name, value); in ZEND_METHOD()
5849 zend_update_property_ex(intern->ce, object, ref->unmangled_name, value); in ZEND_METHOD()
5871 if (!instanceof_function(Z_OBJCE_P(object), intern->ce)) { in ZEND_METHOD()
5878 zval *member_p = zend_read_property_ex(intern->ce, Z_OBJ_P(object), ref->unmangled_name, 0, &rv); in ZEND_METHOD()
5897 zend_update_property_ex(intern->ce, object, ref->unmangled_name, value); in reflection_property_set_raw_value()
5931 method, ZSTR_VAL(intern->ce->name), in reflection_property_check_lazy_compatible()
5939 method, ZSTR_VAL(intern->ce->name), in reflection_property_check_lazy_compatible()
5947 method, ZSTR_VAL(intern->ce->name), in reflection_property_check_lazy_compatible()
5953 if (!zend_class_can_be_lazy(object->ce)) { in reflection_property_check_lazy_compatible()
5956 method, ZSTR_VAL(intern->ce->name)); in reflection_property_check_lazy_compatible()
5977 Z_PARAM_OBJ_OF_CLASS(object, intern->ce) in ZEND_METHOD()
6021 Z_PARAM_OBJ_OF_CLASS(object, intern->ce) in ZEND_METHOD()
6031 zval *src = &object->ce->default_properties_table[OBJ_PROP_TO_NUM(ref->prop->offset)]; in ZEND_METHOD()
6061 Z_PARAM_OBJ_OF_CLASS(object, intern->ce) in ZEND_METHOD()
6091 member_p = zend_read_static_property_ex(intern->ce, ref->unmangled_name, 1); in ZEND_METHOD()
6106 if (!instanceof_function(Z_OBJCE_P(object), ref->prop ? ref->prop->ce : intern->ce)) { in ZEND_METHOD()
6112 EG(fake_scope) = intern->ce; in ZEND_METHOD()
6126 zend_class_entry *ce; in ZEND_METHOD() local
6131 ce = ref->prop ? ref->prop->ce : intern->ce; in ZEND_METHOD()
6132 zend_reflection_class_factory(ce, return_value); in ZEND_METHOD()
6164 ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY, in ZEND_METHOD()
6165 ref->prop->ce->type == ZEND_USER_CLASS ? ref->prop->ce->info.user.filename : NULL); in ZEND_METHOD()
6304 if (UNEXPECTED(zval_update_constant_ex(return_value, prop_info->ce) != SUCCESS)) { in ZEND_METHOD()
6440 intern->ce = NULL; in ZEND_METHOD()
6565 static void add_extension_class(zend_class_entry *ce, zend_string *key, zval *class_array, zend_mod… in add_extension_class() argument
6567 …if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module && !strcasecmp(ce->info.internal.m… in add_extension_class()
6570 if (!zend_string_equals_ci(ce->name, key)) { in add_extension_class()
6575 name = ce->name; in add_extension_class()
6579 zend_reflection_class_factory(ce, &zclass); in add_extension_class()
6594 zend_class_entry *ce; in ZEND_METHOD() local
6600 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { in ZEND_METHOD()
6601 add_extension_class(ce, key, return_value, module, 1); in ZEND_METHOD()
6612 zend_class_entry *ce; in ZEND_METHOD() local
6618 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { in ZEND_METHOD()
6619 add_extension_class(ce, key, return_value, module, 0); in ZEND_METHOD()
6751 intern->ce = NULL; in ZEND_METHOD()
7070 zend_class_entry *ce; in ZEND_METHOD() local
7076 if (NULL == (ce = zend_lookup_class(attr->data->name))) { in ZEND_METHOD()
7081 if (NULL == (marker = zend_get_attribute_str(ce->attributes, ZEND_STRL("attribute")))) { in ZEND_METHOD()
7086 if (ce->type == ZEND_USER_CLASS) { in ZEND_METHOD()
7087 uint32_t flags = zend_attribute_attribute_get_flags(marker, ce); in ZEND_METHOD()
7116 if (SUCCESS != zend_get_attribute_object(&obj, ce, attr->data, attr->scope, attr->filename)) { in ZEND_METHOD()
7131 zend_class_entry *ce; in ZEND_METHOD() local
7132 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
7134 if (!(ce->ce_flags & ZEND_ACC_ENUM)) { in ZEND_METHOD()
7135 …zend_throw_exception_ex(reflection_exception_ptr, -1, "Class \"%s\" is not an enum", ZSTR_VAL(ce->… in ZEND_METHOD()
7143 zend_class_entry *ce; in ZEND_METHOD() local
7150 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
7152 zend_class_constant *class_const = zend_hash_find_ptr(&ce->constants_table, name); in ZEND_METHOD()
7163 zend_class_entry *ce; in ZEND_METHOD() local
7170 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
7172 zend_class_constant *constant = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), name); in ZEND_METHOD()
7174 …zend_throw_exception_ex(reflection_exception_ptr, 0, "Case %s::%s does not exist", ZSTR_VAL(ce->na… in ZEND_METHOD()
7178 …zend_throw_exception_ex(reflection_exception_ptr, 0, "%s::%s is not a case", ZSTR_VAL(ce->name), Z… in ZEND_METHOD()
7182 reflection_enum_case_factory(ce, name, constant, return_value); in ZEND_METHOD()
7188 zend_class_entry *ce; in ZEND_METHOD() local
7194 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
7197 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(CE_CONSTANTS_TABLE(ce), name, constant) { in ZEND_METHOD()
7200 reflection_enum_case_factory(ce, name, constant, &class_const); in ZEND_METHOD()
7209 zend_class_entry *ce; in ZEND_METHOD() local
7213 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
7214 RETURN_BOOL(ce->enum_backing_type != IS_UNDEF); in ZEND_METHOD()
7220 zend_class_entry *ce; in ZEND_METHOD() local
7224 GET_REFLECTION_OBJECT_PTR(ce); in ZEND_METHOD()
7226 if (ce->enum_backing_type == IS_UNDEF) { in ZEND_METHOD()
7229 zend_type type = ZEND_TYPE_INIT_CODE(ce->enum_backing_type, 0, 0); in ZEND_METHOD()
7248 …eflection_exception_ptr, 0, "Constant %s::%s is not a case", ZSTR_VAL(ref->ce->name), Z_STRVAL_P(c… in ZEND_METHOD()
7261 zend_reflection_class_factory(ref->ce, return_value); in ZEND_METHOD()
7276 if (ref->ce->enum_backing_type == IS_UNDEF) { in ZEND_METHOD()
7278 …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()
7292 zval_update_constant_ex(&ref->value, ref->ce); in ZEND_METHOD()
7298 ZEND_ASSERT(intern->ce->enum_backing_type != IS_UNDEF); in ZEND_METHOD()
7317 if (intern->ce) { in ZEND_METHOD()
7323 intern->ce = zend_ce_fiber; in ZEND_METHOD()
7433 if (zend_hash_exists(&object->ce->properties_info, name) in _reflection_write_property()
7437 "Cannot set read-only property %s::$%s", ZSTR_VAL(object->ce->name), ZSTR_VAL(name)); in _reflection_write_property()