1--TEST-- 2Attribute on promoted property may only target property 3--EXTENSIONS-- 4zend_test 5--FILE-- 6<?php 7 8class AttrTest 9{ 10 public function __construct( 11 #[ZendTestPropertyAttribute('foo')] public $param 12 ) {} 13} 14 15$ref = new ReflectionClass(AttrTest::class); 16$attr = $ref->getConstructor()->getParameters()[0]->getAttributes(); 17 18var_dump(count($attr)); 19 20$attr = $ref->getProperty('param')->getAttributes(); 21 22var_dump(count($attr)); 23var_dump($attr[0]->getName()); 24var_dump($attr[0]->newInstance()->parameter); 25 26?> 27--EXPECTF-- 28int(0) 29int(1) 30string(25) "ZendTestPropertyAttribute" 31string(3) "foo" 32