Files
php-src/ext/dom/php_dom_decl.h
David CARLIER 2945c72a14 build/gen_stub: support asymmetric visibility modifiers. (#21773)
Emit ZEND_ACC_PUBLIC_SET / PROTECTED_SET / PRIVATE_SET from the
corresponding Modifiers::*_SET flags in generated arginfo, gated
to PHP 8.4+ where asymmetric visibility was introduced. Previously
private(set) and friends in stubs parsed without error but produced
no set-visibility flag.

@readonly on DOM property stubs was documentation only and did not
translate to any runtime flag, so reflection reported the properties
as writable while the write_property handler threw on assignment.
Declaring them public private(set) lets the engine reject external
writes via the normal visibility check and lets ReflectionProperty::
isWritable() answer honestly.

After converting virtual properties from @readonly to private(set),
dom_write_property still threw a readonly-modification error. Since
the handler replaces zend_std_write_property, the engine's own
asymmetric-visibility check is bypassed on the write path, so the
DOM handler now raises it explicitly via
zend_asymmetric_visibility_property_modification_error() when the
caller lacks set access. The readonly error is kept as a fallback.
2026-04-18 16:47:59 +01:00

15 lines
603 B
C
Generated

/* This is a generated file, edit php_dom.stub.php instead.
* Stub hash: 8d7713834c924709155ed7acc554c9efc55e96c1 */
#ifndef ZEND_PHP_DOM_DECL_8d7713834c924709155ed7acc554c9efc55e96c1_H
#define ZEND_PHP_DOM_DECL_8d7713834c924709155ed7acc554c9efc55e96c1_H
typedef enum zend_enum_Dom_AdjacentPosition {
ZEND_ENUM_Dom_AdjacentPosition_BeforeBegin = 1,
ZEND_ENUM_Dom_AdjacentPosition_AfterBegin = 2,
ZEND_ENUM_Dom_AdjacentPosition_BeforeEnd = 3,
ZEND_ENUM_Dom_AdjacentPosition_AfterEnd = 4,
} zend_enum_Dom_AdjacentPosition;
#endif /* ZEND_PHP_DOM_DECL_8d7713834c924709155ed7acc554c9efc55e96c1_H */