Re: [RFC] DocComments For Function Parameters
| From: | Christian Schneider | Date: | Wed, 25 Feb 2026 00:18:53 +0000 |
| Subject: | Re: [RFC] DocComments For Function Parameters | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130165@lists.php.net to get a copy of this message | ||
Am 24.02.2026 um 21:53 schrieb Christian Schneider <cschneid@cschneid.com>:
> Am 24.02.2026 um 20:13 schrieb Larry Garfield <larry@garfieldtech.com>:
>> 1. As Matthew said, putting the doc comment after the parameter is inconsistent.
>> I've... never actually seen someone do that. I have seen people put doc comments on the line
>> before a parameter (which I then had to move to the function docblock, which was annoying). Every
>> other docblock-able construct has the docblock as a prefix, not suffix. It should be a prefix here
>> as well.
>
> Just to clarify: You can write it before, in the middle or after the parameter, just like you
> can write it before or in the middle of properties.
> The proposal allows pre, middle and post styles.
I changed the example to use the standard docblock-before variant and added a separate example to
explain the option to put the comments behind the parameter definition:
https://wiki.php.net/rfc/parameter-doccomments#example
Regards,
- Chris