Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130156 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id BDA491A00BC for ; Tue, 24 Feb 2026 19:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1771960412; bh=mz6kF3T6w97XKPYncDI7uPSR2FlejS7OQgQH1UHdxHE=; h=Date:From:To:In-Reply-To:References:Subject:From; b=hzZ1/tqNNO/s4RzwcoRNEbiEMRwuXc2tQlFAFl0KZadjJKd1Oph74ecNLknlhGJ29 d/48SS1pu6qOmSX0TtSomj6jRZ5woSWu+mGuDUbIynggoGUUe0EuuB48ARty2427q+ 2y4wFh7Fmc2mIlEddD/0SFG6UMh55Lc/qSAhLb91iFs//W3N9zGR/Fb61emifjrjj8 hUnouOv0+xwO9IpSfjgJ0U/YSRkadtqeDVM+rwgDaCEqyoSWQPWeCYrBRviV2qgPH8 e8+dU/LLAXJBOHpF325CQGIvqT4En15JXMw/FQatCWnD2qe9OZBCqHNCM5s1BCXeQM 244gTCnevrJoA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A86DF180507 for ; Tue, 24 Feb 2026 19:13:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 24 Feb 2026 19:13:31 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 456147A01F3 for ; Tue, 24 Feb 2026 14:13:26 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Tue, 24 Feb 2026 14:13:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1771960406; x=1772046806; bh=GAgsuRGbdOagJ7VzTWN5Z pWGUgego4nSNMx7nhqUatQ=; b=tge/x/SxX1JxA4R7/p0nTSo3Marb5CbmYon0d mNmTxN2QwLnzp/Z9Qr1aiveH2s9EZcRA78nyns8iytlXqJUCg38vKvlzc30+Cfw9 dyhp0FRDe1txCDSwLgRtOi2eaSnpyCjqnJD6gMqeVOYVa4/y4GVtiNGZHxoeLUWx UdzdXvbEPuHPUwcs7CbMc8xR6dsnqy9h8VrU8BqyVXuSWghiLczuOv5M+Djw0qmM x08bKN9AciaNOM/iqkIW4SVTRDjK6egTP/I0sEdWQNI5N7wLljsjbS9pr8krxuto tAXaceoPxjIp+xThX1hfhL/V8YDAsHBcPRXmayKxCm8NXBGbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1771960406; x=1772046806; bh=G AgsuRGbdOagJ7VzTWN5ZpWGUgego4nSNMx7nhqUatQ=; b=JZ+45RYNdeQg5NkfW cYJfOKXXc1QKTGpi7cah4qWT7QIfxjQGAJHq+XFrm0ewpTxqx+d+hMb3dkZeSa/T TlAPW0HTZ6sQypNdVSa4bSIMQZyV0RPEc1ZpSEeZl8xsmMyv7qWgYet7h7vTsabt y3GgkP68CTcMeI54BVIbGjeKgGkpZoiTpB1zdMNR+nFsGAU6tf7FSn+5ZB81dIjk /PsbEmw4HZvfMK7hKTxK76y/P8nIou6HF7pNOuJJy0zfe9izl+PfB2Jhj0Pv24ND EJoCkYxMkfygLQ3Zx/UHo0+/m+Uq2tmyJ6Y9x62DR3SbE+jWf9kHJxRFhdRuCtP7 cRRvA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgedtleekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeeluddvudelkeeijeekueekgfdvieefleevveejfefhfedt uefgudeiueehffelkeenucffohhmrghinhepphhhphdrnhgvthdpghhithhhuhgsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgr rhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhp hhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A6AFF700065; Tue, 24 Feb 2026 14:13:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AfgL8T1aalgk Date: Tue, 24 Feb 2026 13:13:05 -0600 To: "php internals" Message-ID: <5706932f-e005-41cc-8bc5-1fb1fa4e344c@app.fastmail.com> In-Reply-To: <65C41C15-74C2-4A25-ABA7-056D612DF366@cschneid.com> References: <24229A82-F5BF-48F2-9E6C-FE45A99FB9E9@cschneid.com> <65C41C15-74C2-4A25-ABA7-056D612DF366@cschneid.com> Subject: Re: [PHP-DEV] [RFC] DocComments For Function Parameters Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Mon, Feb 23, 2026, at 11:32 AM, Christian Schneider wrote: > Am 22.02.2026 um 18:52 schrieb Tim D=C3=BCsterhus : >> - Please add a link to the ML discussion to the =E2=80=9CReferences=E2= =80=9D section: https://news-web.php.net/php.internals/130121 >>=20 >> - The ABI change is irrelevant: Extensions have to be recompiled for = every PHP branch and new features may not ship with 3rd-digit versions a= nyways. Mentioning this is thus misleading at best (affecting =E2=80=9CB= ackwards incompatible changes=E2=80=9D, =E2=80=9CProposed PHP version=E2= =80=9D, and =E2=80=9CRFC Impact=E2=80=9D). >>=20 >> - In fact, there is not even an ABI change, because the new field is = added at the end of the struct. >>=20 >> - Within the =E2=80=9CEcosystem=E2=80=9D impact, you should probably = mention that this might require adjustments to code style / formatting g= uidelines and autoformatters - or at the very least a decision needs to = be made there. > > Thanks for this feedback. > I changed the RFC accordingly and also added an implementation PR and = a=20 > test and I would consider it ready. > > RFC: https://wiki.php.net/rfc/parameter-doccomments > PR: https://github.com/php/php-src/pull/21279 > > Regards, > - Chris I'm in favor in principle, but have 2 major pushbacks. 1. As Matthew said, putting the doc comment after the parameter is incon= sistent. I've... never actually seen someone do that. I have seen peop= le put doc comments on the line before a parameter (which I then had to = move to the function docblock, which was annoying). Every other docbloc= k-able construct has the docblock as a prefix, not suffix. It should be= a prefix here as well. =20 I'm not sure I can support it as a suffix because it would be so inconsi= stent, and would essentially mandate same-line comments rather than comm= ent on own line. Bear in mind, the parameter line could be quite long i= n a constructor, and the description itself can be quite long, too. public function __construct( public final readonly SomeVerboselyNamedClass $thingie /** We have b= arely any room here. */ // vs /** * We have plenty of room here, and can easily go to multiple lines = if necessary in context.=20 * Which it often is. */ public final readonly SomeVerboselyNamedClass $thingie /** We have b= arely any room here. */ ) {} Prefix docblock is the way to go. 2. I realize the existing getDocComment() implementations also use strin= g|false, but at what point are we going to accept that is a stupid retur= n type and use string|null instead? :-( (I realize it may not be fixabl= e here; I just want to whine about that design flaw propagating even fur= ther.) --Larry Garfield