Description
This worked on 8.4 and before, and doesn't anymore on 8.5:
<?php
#[\Attribute(\Attribute::TARGET_CLASS)]
abstract class Base
{
}
#[\Attribute(\Attribute::TARGET_CLASS)]
class Child extends Base
{
}
#[Child]
class A
{
}
$r = new \ReflectionClass('A');
var_dump($r->getAttributes('Base', ReflectionAttribute::IS_INSTANCEOF));
Resulted in this output:
Fatal error: Cannot apply #[\Attribute] to abstract class Base in /in/isSn6 on line 5
But I expected this output instead:
array(1) {
[0]=>
object(ReflectionAttribute)#2 (1) {
["name"]=>
string(5) "Child"
}
}
PHP Version
Operating System
No response