Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128279 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 3CA601A0136 for ; Mon, 28 Jul 2025 17:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753725308; bh=LWU6l9nM+rCmSsDkaufbUl3ZAbraeiIZ+pLvpjKP5/s=; h=Date:Subject:To:References:From:In-Reply-To:From; b=nnjDHMYCNObo3pGCJad62AEXIhnTS01vnmKV2LLJ80HqGHN+cQ50GYl/7iiqiMmDY TFnOxUa39r9tf6x5e5GNfLVVEficj43JfAF5IvlLtHX3yBHksAdSgGX78p2aG+aFON xePyJHy02DEl5HTFhFVbQVrsSta1v0JPM+EAzDEG6dkvf1Y55GDaE2AykWP3G8k/k8 uFtiE9WsSFvzXELZWa+mqajA6b7Ex/4jEhjP3eyYtvo25AedDIYEr/AxpbYTvzr7SF FZcXm3m71Nvkz3ENOlkKlxcR8s46XzFVmtgn+36gRuyZm28Ck6o+2X9GCC/UnRhELG xDUtAJLI7DeAA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5B843180212 for ; Mon, 28 Jul 2025 17:55: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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) (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 ; Mon, 28 Jul 2025 17:55:03 +0000 (UTC) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 87E451400363 for ; Mon, 28 Jul 2025 13:56:46 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 28 Jul 2025 13:56:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=1753725406; x=1753811806; bh=1xOSq72brd0VGmEeKO2q3119WVUZhKu78jv8MVLPChQ=; b= CBT45ui+HBcx7Y8exO8uaHfiybHYNzT02+YnCajZaK5f871SA/Rrh9RfNqqE+tzK 6LzgsTrtlH/hVCp7qcJwiRs/lM7Zj/iGd/e4HZiuht5UPSSbzG6pDDcfp5D5dvSr cok8ikndyEJMvSX7JDpbR8JjAoMbfI68jJ9z9GZ7vUjDF+ysFlpk8JsmN7pSE3E+ NI1I7MRqhAlM0f3sxcCbiuQoGP9k17ApG3+7kupOQ28xgnyPjZu5fRGir0rAHBV9 /cd+F+TP32G5ZkH9GzhChiER65i47HEbbv1xMt+GqTYe+sShN6TElyzMg1HDokau dVyfGZztca0ekFQBCbJB3A== 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=1753725406; x=1753811806; bh=1 xOSq72brd0VGmEeKO2q3119WVUZhKu78jv8MVLPChQ=; b=J/GW7l3lIMbFIMtwM krN69AndY5HkzoE9R/Y7wtiMUSZjeO2AIRuJio7Kv1uAPj6jKbkxTsHOB+4FVHDw pDh5atGU3zjVWb/yq+1aB+ycbht5RP0j9VzmqfjXz1eDf4v3o/2u+aDsN0rX/53r xF3Y7Khs7vVBV9HzvA1zRRB7/AoV8st98HECHDTzjSZsiLji6iIzz9BTvQdpkV3h XnIBsNVljDzI36UQaGvrPy0O159x3AOqe0mpSZClwqh5g4GIGD+9x+8YnbsKWaZ3 JAAsVhMCsHRnleQ4GJp1Phh0adwtjvSmw5HDEfxKP1TnY7uFTXbl/zhlsNw4Ai5r cZlyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdelvdekfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttd dvjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehi mhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhepffekve duffduvdehjedvfeekleeftddugeefheejudehgeeiudffgeeggeevfeehnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhph esrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 28 Jul 2025 13:56:45 -0400 (EDT) Message-ID: Date: Mon, 28 Jul 2025 18:56:44 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [DISCUSSION] User-land Throwable Content-Language: en-GB To: internals@lists.php.net References: <73a35675dff31a1eaf76b67af567194e@bastelstu.be> <67c55236-268b-47d3-9873-dec4732876b5@app.fastmail.com> In-Reply-To: <67c55236-268b-47d3-9873-dec4732876b5@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 28/07/2025 16:27, Larry Garfield wrote: > (I actually have no idea what the original reason was for making so much of Exceptions final.) If you start with everything marked "final", you can relax it as needed. For internal classes particularly, there can be implementation and performance penalties to letting users over-ride certain parts. In this case, the trace is actually stored in a private property, and accessed separately by: * getTrace() * getTraceAsString() * the default output for uncaught errors * a couple of extensions that do weird hacks with it Presumably, we would want all of these to polymorphically call getTrace() instead, to get the customised output. That might not be trivial, e.g. it means an error handler calling into userland code which could itself trigger errors. If we don't provide that consistency, there's not much advantage over writing $trace = ($e instanceof ThrowableWithCustomisedTrace) ? $e->getCustomisedTrace() : $e->getTrace(); I wonder if there's actually an X/Y Problem here: is what is actually wanted more ways to affect what goes into the backtrace, or permanently edit it? We have #[SensitiveParameter], could we also have #[SkipCallInTrace]? Could we have a way to construct an exception with a custom trace? As long as the format is correct when written to the private property, we don't need to change existing code that reads directly from that property. -- Rowan Tommins [IMSoP]