52 "Attribute::__construct(): Argument #1 ($flags) must be of type int, %s given",
71static void validate_allow_dynamic_properties(
233 return get_attribute_str(attributes, str,
len, 0);
243 return get_attribute_str(attributes, str,
len,
offset + 1);
248 if (i >=
attr->argc) {
276 call = zend_vm_stack_push_call_frame_ex(
280 0, &dummy_func, 0,
NULL);
287 call->opline = opline;
291 call->prev_execute_data =
EG(current_execute_data);
295 call->func->op_array.fn_flags =
298 call->func->op_array.filename = filename;
300 EG(current_execute_data) =
call;
309 if (attribute_data->
argc) {
312 for (uint32_t i = 0; i < attribute_data->
argc; i++) {
333 for (uint32_t i = 0; i < argc; i++) {
344 EG(current_execute_data) =
call->prev_execute_data;
345 zend_vm_stack_free_call_frame(
call);
351static const char *target_names[] = {
364 for (uint32_t i = 0; i < (
sizeof(target_names) /
sizeof(
char *)); i++) {
365 if (
flags & (1 << i)) {
366 if (smart_str_get_len(&str)) {
367 smart_str_appends(&str,
", ");
370 smart_str_appends(&str, target_names[i]);
374 return smart_str_extract(&str);
383 if (zend_string_equals(other->
lcname,
attr->lcname)) {
392static void attr_free(
zval *
v)
397 zend_string_release(
attr->name);
398 zend_string_release(
attr->lcname);
400 for (uint32_t i = 0; i <
attr->argc; i++) {
401 if (
attr->args[i].name) {
402 zend_string_release(
attr->args[i].name);
417 if (*attributes ==
NULL) {
425 attr->name = zend_string_copy(
name);
432 attr->lineno = lineno;
437 for (uint32_t i = 0; i < argc; i++) {
442 zend_hash_next_index_insert_ptr(*attributes,
attr);
447static void free_internal_attribute(
zval *
v)
464 internal_attr->
ce = ce;
469 zend_hash_update_ptr(&internal_attributes,
lcname, internal_attr);
470 zend_string_release(
lcname);
472 return internal_attr;
476 zend_error_noreturn(
E_ERROR,
"Classes must be first marked as attribute before being able to be registered as internal attribute class");
489 return zend_hash_find_ptr(&internal_attributes,
lcname);
506 attr->validator = validate_allow_dynamic_properties;
512 attributes_object_handlers_sensitive_parameter_value.get_properties_for = attributes_sensitive_parameter_value_get_properties_for;
memset(ptr, 0, type->size)
#define get_attribute(node, name)
zend_attribute_arg args[1]
void(* validator)(zend_attribute *attr, uint32_t target, zend_class_entry *scope)
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format,...)
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API zend_result object_init_with_constructor(zval *arg, zend_class_entry *class_type, uint32_t param_count, zval *params, HashTable *named_params)
ZEND_API void zend_update_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zval *value)
#define ZEND_PARSE_PARAMETERS_END()
#define Z_PARAM_STR_OR_NULL(dest)
#define ZEND_PARSE_PARAMETERS_NONE()
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define Z_PARAM_LONG(dest)
#define ZEND_METHOD(classname, name)
#define RETURN_EMPTY_ARRAY()
#define Z_PARAM_ZVAL(dest)
#define ZEND_MM_ALIGNED_SIZE_EX(size, alignment)
#define pefree(ptr, persistent)
#define pemalloc(size, persistent)
ZEND_API zend_internal_attribute * zend_internal_attribute_get(zend_string *lcname)
ZEND_API zend_internal_attribute * zend_internal_attribute_register(zend_class_entry *ce, uint32_t flags)
ZEND_API zend_class_entry * zend_ce_override
ZEND_API zend_class_entry * zend_ce_sensitive_parameter_value
ZEND_API zend_attribute * zend_add_attribute(HashTable **attributes, zend_string *name, uint32_t argc, uint32_t flags, uint32_t offset, uint32_t lineno)
ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_class_entry *scope)
ZEND_API zend_result zend_get_attribute_object(zval *obj, zend_class_entry *attribute_ce, zend_attribute *attribute_data, zend_class_entry *scope, zend_string *filename)
ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr)
void zend_attributes_shutdown(void)
ZEND_API zend_class_entry * zend_ce_sensitive_parameter
ZEND_API zend_attribute * zend_get_attribute(HashTable *attributes, zend_string *lcname)
ZEND_API zend_class_entry * zend_ce_allow_dynamic_properties
uint32_t zend_attribute_attribute_get_flags(zend_attribute *attr, zend_class_entry *scope)
ZEND_API zend_attribute * zend_get_parameter_attribute_str(HashTable *attributes, const char *str, size_t len, uint32_t offset)
ZEND_API zend_string * zend_get_attribute_target_names(uint32_t flags)
ZEND_API zend_class_entry * zend_ce_attribute
ZEND_API zend_attribute * zend_get_attribute_str(HashTable *attributes, const char *str, size_t len)
void zend_register_attribute_ce(void)
ZEND_API zend_attribute * zend_get_parameter_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset)
ZEND_API zend_class_entry * zend_ce_return_type_will_change_attribute
ZEND_API zend_class_entry * zend_ce_deprecated
ZEND_API zend_internal_attribute * zend_mark_internal_attribute(zend_class_entry *ce)
#define ZEND_ATTRIBUTE_FLAGS
#define ZEND_ATTRIBUTE_TARGET_ALL
#define ZEND_ATTRIBUTE_SIZE(argc)
struct _zend_attribute zend_attribute
struct _zend_internal_attribute zend_internal_attribute
#define ZEND_ATTRIBUTE_STRICT_TYPES
#define ZEND_ATTRIBUTE_PERSISTENT
#define OBJ_PROP_NUM(obj, num)
#define ZEND_ACC_STRICT_TYPES
#define ZEND_USER_FUNCTION
#define ZEND_ACC_INTERFACE
#define ZEND_ACC_CALL_VIA_TRAMPOLINE
#define ZEND_ACC_READONLY_CLASS
#define ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES
#define ZEND_INTERNAL_CLASS
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_entry *scope)
union _zend_function zend_function
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_add_new(HashTable *ht, zend_string *key, zval *pData)
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_PACKED_FOREACH_PTR(ht, _ptr)
#define ZEND_HASH_FOREACH_PTR(ht, _ptr)
#define zend_new_array(size)
#define ZEND_HASH_FOREACH_END()
struct _zend_string zend_string
ZEND_API const zend_object_handlers std_object_handlers
enum _zend_prop_purpose zend_prop_purpose
ZEND_API zend_string *ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, bool persistent)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
struct _zend_array HashTable
#define ZVAL_COPY_OR_DUP(z, v)
ZEND_RESULT_CODE zend_result
struct _zend_object_handlers zend_object_handlers
struct _zend_execute_data zend_execute_data
#define ZVAL_COPY_VALUE(z, v)
#define IS_STR_PERSISTENT
ZEND_API void zval_internal_ptr_dtor(zval *zval_ptr)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)