blob: e0e57c744cb572de16f73eb7796df7210f256c91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--TEST--
Enum attributes
--FILE--
<?php
#[Attribute]
class EnumAttribute {
public function __construct(
public string $value,
) {}
}
#[EnumAttribute('Foo')]
enum Foo {}
var_dump((new \ReflectionClass(Foo::class))->getAttributes(EnumAttribute::class)[0]->newInstance());
?>
--EXPECT--
object(EnumAttribute)#1 (1) {
["value"]=>
string(3) "Foo"
}
|