- Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
- Class A: 'AutowireProperty' Class B: 'AutowireProperty'
<?php
#[\Attribute(\Attribute::TARGET_PROPERTY)]
final class AutowireProperty {}
class A {
#[AutowireProperty]
protected string $foo;
}
class B extends A {
}
$fooA = new \ReflectionProperty(A::class, 'foo');
$fooB = new \ReflectionProperty(B::class, 'foo');
echo "Class A: ";
var_export($fooA->getAttributes()[0]->getName());
echo "\n";
echo "Class B: ";
var_export($fooA->getAttributes()[0]->getName());
echo "\n";