php-src/Zend/tests/attributes/027_trailing_comma_args.phpt

31 lines
445 B
Plaintext
Raw Normal View History

--TEST--
Trailing comma in attribute argument list
--FILE--
<?php
2020-08-15 08:39:00 +00:00
#[MyAttribute(
"there",
"are",
"many",
"arguments",
2020-08-15 08:39:00 +00:00
)]
class Foo { }
$ref = new \ReflectionClass(Foo::class);
$attr = $ref->getAttributes()[0];
var_dump($attr->getName(), $attr->getArguments());
?>
--EXPECT--
string(11) "MyAttribute"
array(4) {
[0]=>
string(5) "there"
[1]=>
string(3) "are"
[2]=>
string(4) "many"
[3]=>
string(9) "arguments"
}