Am 21.02.2026 um 19:41 schrieb Matthew Weier O'Phinney
<[email protected]>:
> - Would it also support the comment appearing before the parameter?
>
> /** This is the description */
> string $message,
Yes, this works.
> - If so, what would be the behavior of the engine if a docblock was present
> in both positions, like:
>
> /** This is the description */
> $message
> /** But what about this? */,
The last DocComment wins, the same as for the current
class A
{
/** a */ public /** b */ int /** c */ $property /** d */;
}
echo (new ReflectionClass('A'))->getProperties()[0]->getDocComment();
This outputs the last one (/** d */), see https://3v4l.org/PZFHD
Regards,
- Chris