mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
db6e60e744
While the specified restriction was checked, the #[Attribute] attribute did not specify the flags parameter, so that Reflection returned incorrect information. In particular, Attribute itself has a CLASS target, not an ALL target.
26 lines
510 B
PHP
26 lines
510 B
PHP
--TEST--
|
|
Attributes: attributes on Attribute return itself
|
|
--FILE--
|
|
<?php
|
|
|
|
$reflection = new \ReflectionClass(Attribute::class);
|
|
$attributes = $reflection->getAttributes();
|
|
|
|
foreach ($attributes as $attribute) {
|
|
var_dump($attribute->getName());
|
|
var_dump($attribute->getArguments());
|
|
|
|
$a = $attribute->newInstance();
|
|
var_dump(get_class($a));
|
|
var_dump($a->flags == Attribute::TARGET_CLASS);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
string(9) "Attribute"
|
|
array(1) {
|
|
[0]=>
|
|
int(1)
|
|
}
|
|
string(9) "Attribute"
|
|
bool(true)
|