summaryrefslogtreecommitdiff
path: root/Zend/tests/bug79897.phpt
blob: 201a89f73920d2d54c2758340c3695f696b1f101 (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
37
38
--TEST--
bug79897: Promoted constructor params with attribs cause crash
--FILE--
<?php

#[Attribute]
class B {
    public function __construct($value)
    {
    }
}

class A {
    public function __construct(
        #[B(12, X)] public $b
    )
    {
    }
}

const X = 42;

var_dump((new ReflectionParameter(['A', '__construct'], 'b'))->getAttributes()[0]->getArguments());
var_dump((new ReflectionProperty('A', 'b'))->getAttributes()[0]->getArguments());
?>
--EXPECT--
array(2) {
  [0]=>
  int(12)
  [1]=>
  int(42)
}
array(2) {
  [0]=>
  int(12)
  [1]=>
  int(42)
}