php-src/ext/reflection/tests/property_hooks
Arnaud Le Blanc 24b191a4de
Fix ReflectionProperty::getRawValue() and related methods for properties overridden with hooks
`new Reflectionproperty($scope, $propName)` keeps a reference to the
zend_property_info of $propName declared in $scope. In getRawValue() and
related methods, we use this reference to check whether the property is hooked.

Calling `new ReflectionProperty($scope, $propName)->getRawValue($object)` is
equivalent to the expression $object->$propName from scope $scope (except that
it bypasses hooks), and thus may access an overridden property (unless the
original is private). This property may have hooks and different flags.

Here I fetch the effective property info before checking for hooks and
property flags.

Fixes GH-17713
Closes GH-17714
2025-02-07 10:49:02 +01:00
..
basics.phpt Implement ReflectionProperty::hasHook[s] 2024-09-16 14:28:41 +02:00
bug_001.phpt
gh15718.phpt
gh17713.phpt Fix ReflectionProperty::getRawValue() and related methods for properties overridden with hooks 2025-02-07 10:49:02 +01:00
hook_guard.phpt
ReflectionClass_getMethods.phpt
ReflectionProperty_getHook_inheritance.phpt Implement ReflectionProperty::hasHook[s] 2024-09-16 14:28:41 +02:00
ReflectionProperty_getHooks.phpt Implement ReflectionProperty::hasHook[s] 2024-09-16 14:28:41 +02:00
ReflectionProperty_getSetRawValue.phpt
ReflectionProperty_getSetValue.phpt
ReflectionProperty_isInitialized.phpt Fix ReflectionProperty::isInitialized() for hooked props 2024-09-10 14:46:16 +02:00