1--TEST-- 2Trailing comma in attribute argument list 3--FILE-- 4<?php 5 6#[MyAttribute( 7 "there", 8 "are", 9 "many", 10 "arguments", 11)] 12class Foo { } 13 14$ref = new \ReflectionClass(Foo::class); 15$attr = $ref->getAttributes()[0]; 16var_dump($attr->getName(), $attr->getArguments()); 17 18?> 19--EXPECT-- 20string(11) "MyAttribute" 21array(4) { 22 [0]=> 23 string(5) "there" 24 [1]=> 25 string(3) "are" 26 [2]=> 27 string(4) "many" 28 [3]=> 29 string(9) "arguments" 30} 31