blob: a448cb80d63cdc69644f7b88a8c8d060e95f2a05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
--TEST--
Attributes can be applied to groups of properties
--FILE--
<?php
class C
{
#[A(1, X)]
public $x, $y;
}
const X = 2;
$rp1 = new ReflectionProperty('C', 'x');
$ra1 = $rp1->getAttributes()[0];
var_dump($ra1->getName(), $ra1->getArguments());
$rp2 = new ReflectionProperty('C', 'y');
$ra2 = $rp2->getAttributes()[0];
var_dump($ra2->getName(), $ra2->getArguments());
?>
--EXPECT--
string(1) "A"
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
string(1) "A"
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
|