xref: /php-src/ext/zend_test/tests/gh13970.phpt (revision f8d1864b)
1--TEST--
2GH-13970 (Incorrect validation of #[\Attribute]'s first parameter)
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7#[Attribute(\ZendTestUnitEnum::Foo)]
8class Foo {}
9
10#[Foo]
11function test() {}
12
13$reflection = new ReflectionFunction('test');
14
15try {
16    var_dump($reflection->getAttributes()[0]->newInstance());
17} catch (Error $e) {
18    echo $e->getMessage(), "\n";
19}
20?>
21--EXPECT--
22Attribute::__construct(): Argument #1 ($flags) must be of type int, ZendTestUnitEnum given
23