Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130595 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 70FD11A00BC for ; Thu, 9 Apr 2026 13:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775741408; bh=02zUsGWo9BR8jc7zOTeexy3bJAyPgPf5sRb/cwp42QQ=; h=From:Subject:Date:To:From; b=ilqBv0nnvUx9ztV8ZwaTdCc8vQR1+ZxkT/lZ2pxz8NNYI8NYvwDGza+9X6qaZaYh6 piac5gFDRZLrHog3LXG3051zsxgUGXl9KPt9CEBt6u7bHNyBgAzj0ohXdCjz87n28B MSh7Z9uyCPXiQBJ/GJxasnRMLnxFaHTv9llp6vcxj4xUcaHZg2E6BOiiKXOha/Wcnb ebHNdB52hs34q02/1WVhf1C2LBG/vmjFyPH9WocSxOWE8XNBg9M/Col+i9XL0TM1z/ 7zjp8n2BgoleCPcP08pPZRKmKXd0U/7+K114onxaUL3lFHGB5ZubNja9KVbopKp/K9 0Vic+zOAfsDZw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CB1EC180077 for ; Thu, 9 Apr 2026 13:30:06 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail.gna.ch (darkcity.gna.ch [84.234.28.114]) (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 ; Thu, 9 Apr 2026 13:30:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.gna.ch (Postfix) with ESMTP id 29F462380A57 for ; Thu, 09 Apr 2026 15:29:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1775741399; bh=02zUsGWo9BR8jc7zOTeexy3bJAyPgPf5sRb/cwp42QQ=; h=From:Subject:Date:To; b=QOeXiKQhKJNNAKYrAsIKghbbcTR4QyMCTRZ4doxwmYoL+tZqnhsXA7IU9obW8Qb2M sIVtTLHugm7vER93FEbHgxTNM4pLnm5XCqyDQCK6WZFWXvyKMyMVwTxFU1TiyJ9SWa 8V8dN31Xw8jjE0cPQ269Jy7YPUF5wEYkz41k6OKA= X-Virus-Scanned: amavis at gna.ch Received: from mail.gna.ch ([127.0.0.1]) by localhost (mail.gna.ch [127.0.0.1]) (amavis, port 10024) with ESMTP id 7EdOJB_37p_N for ; Thu, 9 Apr 2026 15:29:58 +0200 (CEST) Received: from smtpclient.apple (unknown [194.169.219.181]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.gna.ch (Postfix) with ESMTPSA id C7B6C2380A40 for ; Thu, 09 Apr 2026 15:29:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1775741398; bh=02zUsGWo9BR8jc7zOTeexy3bJAyPgPf5sRb/cwp42QQ=; h=From:Subject:Date:To; b=Z7+zSEliPPM0NWxUPnQuxFoXPIWNsgLs50cLik2i0pCwuyrUBsOkfeEPq6LlkaP5o F5/DaoU7fwcfQQqEtGKJtSy9vQIwpbMmvlplegQkhIcHF2qsWrMTdDR5v4QHJ5oVWu T/hCZOnZJS79eONudc6xiuvEqpijOC0BhwL772/E= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: [PHP-DEV] DocComments for internal functions Message-ID: Date: Thu, 9 Apr 2026 15:29:58 +0200 To: PHP internals list X-Mailer: Apple Mail (2.3864.500.181) From: cschneid@cschneid.com (Christian Schneider) As a follow-up to the now-merged DocComments for function parameters I = would like to propose annotating internal functions with DocComments = automatically generated from the documentation. This would benefit e.g. LSPs and static analysers written in PHP to use = reflection to show (a minimal) documentation for internal (e.g. strlen), = basic (e.g. str_replace) and bundled extension functions (e.g. = grapheme_strlen). To this end I 1) extended zend_internal_arg_info and zend_internal_function_info 2) added macros like ZEND_ARG_INFO_DOCCOMMENT to zend_API.h 3) added a script build/add_doccomments.php to extract the documentation = from a doc-en (or other language) checkout 4) extended build/gen_stub.php to generate the new = ZEND_ARG_INFO_*_DOCCOMMENT macros for @genstubs-expose-comment-block With this in place one can generate the internal doc comments with ./build/add_doccomments.php ./build/gen_stub.php --force The implementation can be examined at = https://github.com/php/php-src/compare/master...chschneider:php-src:intern= al-functions-doccomments Questions: - Is there interest in adding this feature? - How should it be integrated into the build process? A simple version = would be to run the two scripts (with doc-en) before generating a = release, a more complicated version could add a configure option to also = be able to chose a local documentation checkout (e.g. for a different = language) - Does this require an RFC or should this be discussed here and (in case = there is interest) in a PR I would create? Regards, - Chris