Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130249 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 A453F1A00BC for ; Wed, 4 Mar 2026 19:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772652281; bh=CwLWRGfWN+58raQE9Q/pizf82pjtozhRXqoeiyVpJ0M=; h=From:Subject:Date:To:From; b=UGA5laxzeGKjUduL2rBVF9ee9OA79F+pzHad70zYrsMrUgec5pv5hNCmlgky+6WSs DyeVPEfeywZM3frpYrOgcD26qy/iZiywQUew2kjEgbxG5mLZ0tQAGoZdxXn5Vp617o hwfa6XNg4oiCNMph2Xcv5MWjCDzE+OxLV8eJfBde/nCGzW/A+PL/nREmxFiWmcMDiL RiFDTF6Q5MVCIJNF2+Nn7J2Gj8e0y8G0Llven7iiabBsfCw1ZkNvotGxR1ewiz5yAl aV6I4V/daKXpctiSlYpgiQfdkIoCu2hGQ/v0f12ESnlGsER0Od9vp/J+Xmzk3V2EMu CcOcNlwJBoIOQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6006F180062 for ; Wed, 4 Mar 2026 19:24:40 +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.8 required=5.0 tests=BAYES_50,DMARC_MISSING, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from supercat.cmpct.info (supercat.cmpct.info [71.19.146.230]) (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 ; Wed, 4 Mar 2026 19:24:29 +0000 (UTC) Received: from smtpclient.apple (fctnnbsc38w-142-134-101-31.dhcp-dynamic.fibreop.nb.bellaliant.net [142.134.101.31]) by supercat.cmpct.info (Postfix) with ESMTPSA id 3592142524 for ; Wed, 04 Mar 2026 19:24:23 +0000 (UTC) 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.400.21\)) Subject: [PHP-DEV] Displaying function arguments in errors Message-ID: <48497C73-5009-4ABC-A83A-702EFD4FAB7F@cmpct.info> Date: Wed, 4 Mar 2026 15:24:11 -0400 To: PHP internals X-Mailer: Apple Mail (2.3864.400.21) From: calvin@cmpct.info (Calvin Buckley) Hi internals, I'm dusting off an old PR (GH-12276) I had that I had lying around that I think would be quite useful. Currently, errors in PHP can optionally return some parameter info in the docref call; in practice, few do so, except a few functions. This means if you're looking at a PHP error log, you can see what function is failing, but often not why without having to step debug it. What this PR will do is effectively turn this: ``` Warning: unlink('/tmp'): Operation not permitted in = /Users/calvin/src/chmod.php on line 3 Warning: chown('/', 'calvin'): Operation not permitted in = /Users/calvin/src/chmod.php on line 4 Warning: chmod('/', 511): Operation not permitted in = /Users/calvin/src/chmod.php on line 5 ``` Into this: ``` Warning: unlink(/tmp): Operation not permitted in = /Users/calvin/src/chmod.php on line 3 Warning: chown(): Operation not permitted in /Users/calvin/src/chmod.php = on line 4 Warning: chmod(): Operation not permitted in /Users/calvin/src/chmod.php = on line 5 ``` This should make it easier at a glance to see what goes wrong in a log. Because this reuses the current infrastructure for stack traces, this will also handle i.e. sensitive parameters for free. Because this may not always be desirable (i.e. log size, logging PII that wasn't tagged as sensitive, not having to rewrite every .phpt file), this will be an INI option. We can vote on what should be the defaults, and what should be done with tests. Note that the docref's parameter will be displayed if it's turned off (or i.e. out of memory). I think this will almost certainly need an RFC; if there's interest, I'll start working on that. Regards, Calvin PR is at: https://github.com/php/php-src/pull/12276=