1--TEST-- 2Named flags parameter for Attribute attribute (incorrect parameter name) 3--FILE-- 4<?php 5 6// TODO: This should error at compile-time. 7#[Attribute(not_flags: Attribute::TARGET_CLASS)] 8class MyAttribute { 9} 10 11#[MyAttribute] 12function test() {} 13 14(new ReflectionFunction('test'))->getAttributes()[0]->newInstance(); 15 16?> 17--EXPECTF-- 18Fatal error: Uncaught Error: Attribute "MyAttribute" cannot target function (allowed targets: class) in %s:%d 19Stack trace: 20#0 %s(%d): ReflectionAttribute->newInstance() 21#1 {main} 22 thrown in %s on line %d 23