Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127199 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 qa.php.net (Postfix) with ESMTPS id D4FF21A00BC for ; Sun, 27 Apr 2025 14:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745765339; bh=yTUHFwXdLOGXM6rZUMOQIprb3B0tZbf3lLaIJKbtSyc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dhUS+MaYs5SaGJ8p1K8XXOC27dKhPwJYzIYvYIRwZbEM/cvoF83CWYR1oShqje8dm LAAkHAiNnPM5SGpmETslEN96y2zME9eB1fTAX8hi9eOxDJR7leUy44OS1r/1Ty5Qf+ FO21riCzyBXo9Hc274zqIyXOWJPTjXO/2SPzTTux6PtVZjFw2ba81eGBIw1E/mWU3f iNTrZYAKjdXfZZL5Hffat4MqYL1FUKCQr8A0TrU1At8oQw/DXW13YpY8QJeKYJKftT FWCBp2DqPLifiNCihguN7sYcaFZpeETP4hkBljMUeZmu/C0LAiNwF1dPAN41oI7+jY 9tCuCB8XUrPyA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 70B38180086 for ; Sun, 27 Apr 2025 14:48:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_PDS_PRO_TLD autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from panther.cherry.relay.mailchannels.net (panther.cherry.relay.mailchannels.net [23.83.223.141]) (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 ; Sun, 27 Apr 2025 14:48:57 +0000 (UTC) X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A86352C1EF0; Sun, 27 Apr 2025 14:51:13 +0000 (UTC) Received: from server52.areait.lv (100-105-167-8.trex-nlb.outbound.svc.cluster.local [100.105.167.8]) (Authenticated sender: yszpovajlk) by relay.mailchannels.net (Postfix) with ESMTPA id 7DD572C1812; Sun, 27 Apr 2025 14:51:12 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1745765472; a=rsa-sha256; cv=none; b=NY+fnkjyB1JbrDyIz85yZIUIfJQsScVtAfr3y8PVf3m9+qHX9cEXGGaJnlfTVeF335ssHA KhA5Wn95Vh0/XShSZnT01MFlHOptOTmTyvziBBp8M/qP/jfuRzgUvAcECVIaXH7rOAL3ot wRHLU3JSt5Ghg2YPm0HBmWpkWnZgA01aleNwp+39afCuKPJulUIR3kzFDLe2Tn6qsbsIop VZaVU2nfU6ySQeZR6QThT3aKC5IsnehfW35KyaInH4rRi9PqvcNWrCajCPvLNtgxnZMBQa gufHojjd35yhOQbqlklBuhTwxFUCMxiGjEbVwYHA5N5GzBaxe0DbIUQbdBgBNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1745765472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RqBv/db2uxZ415MDbqoJSIYxZ7CT29DDYznSGvmjYCc=; b=XsH9ENg9q0xWy1iLpVkgqLHH6SaNHDB1ybxQsesgxuZscEi7Al9DuZR+XOsv/95yUxsbjN 8hyZ7aqKRBUhHsOzbVt+BTsenaUHArPJip/gPJsLGp4Bvgcbquu5wrbmMTOlW6JWmutvjk 3CbcPMEfMUjah/aqpAKH1Fi48AQu0ItedQaQ5kUX8v3HH4lpmDsfp2tjoP5tnrkr29TC8Z gOLg6eNEmKAQUZsDLhX5NqGee96LGn4MjLFc4HZJZWTwNIKefBE13DHNxTeKTNa2/wFK74 AIC9zhBSRpaBJKo+bSFV7l1RmckivL0owduJF0ofJG5/xEtOYm4FIo3V3uq4pw== ARC-Authentication-Results: i=1; rspamd-6d6c74965d-w9s5w; auth=pass smtp.auth=yszpovajlk smtp.mailfrom=juris@glaive.pro X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro X-MC-Relay: Neutral X-MailChannels-SenderId: yszpovajlk|x-authuser|juris@glaive.pro X-MailChannels-Auth-Id: yszpovajlk X-Keen-Stop: 7140b3b439a7b1e9_1745765473174_630244447 X-MC-Loop-Signature: 1745765473174:1214093641 X-MC-Ingress-Time: 1745765473174 Received: from server52.areait.lv (server52.areait.lv [83.149.95.205]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.105.167.8 (trex/7.0.3); Sun, 27 Apr 2025 14:51:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=glaive.pro; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=RqBv/db2uxZ415MDbqoJSIYxZ7CT29DDYznSGvmjYCc=; b=empG0IqMUmYlQ+tBaEMqDl/pgI 1cURwLBdWmDxz0h6OXdYQ7WIZvfvH3wY+tAK3bpV7J47kLcNQ6uiaFEpXn6e5qhMzlaYdg3KRwRV1 ql0g34XvcD14CyqnB/63hfOWA7gN6AEXhnrKcmp/m5k6+GFdGW7ApiRInJXQtWoyxxAfgBeoiGjLm xDFDBXEuhdqiKIdlcXZJ8V9BPLZKXIl6cJxWy9DyDT5y8dyvgbuwU8jecJ1F364vTXI2Clzl000rv tTsB3DUJNsFIyNXwXv/pdaJYn2rpFFX/amnxq00f4BCt8rArjZiu0DEs/f2ovzZQdiNTlnnMnXKYi 1FRKPl4Q==; Received: from [::1] (port=44400 helo=glaive.pro) by server52.areait.lv with esmtpa (Exim 4.98.1) (envelope-from ) id 1u93LW-0000000CVRc-3o9Y; Sun, 27 Apr 2025 17:51:11 +0300 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sun, 27 Apr 2025 17:51:06 +0300 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] Concept: Lightweight error channels In-Reply-To: <2a2fef34-d610-4f6a-9c7d-16c98c724c83@app.fastmail.com> References: <39597a9c-6854-40c6-a529-32b2b178cb27@app.fastmail.com> <003901dbb6ee$15dc1c60$41945520$@glaive.pro> <2a2fef34-d610-4f6a-9c7d-16c98c724c83@app.fastmail.com> User-Agent: Roundcube Webmail/1.4.8 Message-ID: X-Sender: juris@glaive.pro Organization: SIA "Glaive.pro" Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-AuthUser: juris@glaive.pro From: juris@glaive.pro (Juris Evertovskis) On 2025-04-27 08:42, Larry Garfield wrote: > There's two key problems with exceptions as PHP currently has them: > > 1. Creating and attaching the backtrace to them is stupidly expensive. > It's one of the most expensive things you can ask the engine to do, I > think. Would an EmptyBacktraceException solve it then? Ideally a LightException would gather the call stack in it's backtrace as it bubbles up until it's caught. It migth solve most of the legit reporting needs with an insignificant performance impact. No idea if it's doable though. > 2. They're unchecked, which means as a developer calling a function you > have absolutely no idea what exceptions it might throw without reading > every line of that function and every function it calls, transitively. > That means it's extremely easy for an exception to kill the process if > no > one expects to catch it. Why wouldn't these raises end up with the same issue? I call `inverse($x)` of a lib, it calls `div(1, $x)` internally, fails to handle the raise and I end up with a crash/exception of the old kind. Or is `inverse` forced to check every possible raise of `div`? But that's probably clumsy, sometimes redundant and not something that can be enforced during compilation. So we still end up with runtime exceptions from somewhere deep in the lib, but instead of "ZeroDivisor" they are "unhandled raise" exceptions? Sorry, I guess this somewhat overlaps with the bubbling portion that you haven't thought through, but I'm continuing to ask because it seems I'm not the only one having hard time to grasp the feeling of the proposed model. BR, Juris