Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122302 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84803 invoked from network); 6 Feb 2024 15:54:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Feb 2024 15:54:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707234942; bh=dPT7ipw9wGBYWIiA6iQPOg1sKm//QY6a9qy1tX1xrY4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HTNEsBKt9nd777S7/SCw3e2dYzfB79zpL1OE41JdUMkDaVYcXoc0bSLjjkiReNhQK zN9WeH2ySwMO6Xpz5gUqa5NCiSVMHVcAAxad81OfgC0QQpEvzRV9n9vmE/RfK2zXkc IcBQE1htaoI1qGuuJiG/eaLvNzH2c5I4ZHmt7PncShEhRK0ny/J+/aIb61u50JpTC/ AUjMUcgrtQYprWhVeSRApkkhXvbftoSGUDVanCnDD9lbDxR7ompgvbmzX7kv4txB8b Pwky1n7oLbVWsJ9FS5bGX0Qe/GzTVpZR9agQXaEDWdea6jYXBfB8AyCa8LgPIUxxd7 4Sku6Y2w853sg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A135C180042 for ; Tue, 6 Feb 2024 07:55:38 -0800 (PST) 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=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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, 6 Feb 2024 07:55:38 -0800 (PST) Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-363d942478dso200585ab.2 for ; Tue, 06 Feb 2024 07:54:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707234885; x=1707839685; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dPT7ipw9wGBYWIiA6iQPOg1sKm//QY6a9qy1tX1xrY4=; b=aMlYgYYaFPgxaM+tBpw7HnOT0IpJdwjyVLZ5EqXVljjfMGYPqsmEKvrQ1ZFGxgqMSl pee+jqwN254dvQMpTIOD6NUGqoAy4uFtmN4GGSxfJhxowUN7cBU5ffM80yEyQgxS22b5 lzHT0yuHe32zZts5rrktW6DMprQXSez5oNmW992Ic1v0PLFpxWo0B3UkS5z5NFA0wnSf 8m5DXGCg9V/1FOkjrIydAI8KAdYRb6Eu0ABDnwHf2Sdud1l1TEvAZI98jvfblHPlN0vW /UpAtzA3S5466xAW/KVk7702p6yzkPXtCN/WTy2+4Qd9g56JMKTN4yLBun3xhbM7JBWU bSpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707234885; x=1707839685; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dPT7ipw9wGBYWIiA6iQPOg1sKm//QY6a9qy1tX1xrY4=; b=OJzF4qTOtpuYUTwzZnN4t9HDgZJ6sAGYMZvjqaMJf5d2TzmeZ+cQ1fFt8kfLEhF1Ij gab7rgWv4uIe82xQS5O5Vi5zzDNJRW9tW0Yo/RUWU+yCJMZan9DGpue4UFtWh4WJS+cC t4wgy+x9uUFJekabhGy7Mq29S3yoe0Ts5naZ8bgRoXfTIF5jaDtub3qfDTctSnxV0X4s lrzNCdAN3u9qQ86kQgcd0NvjhZ41DIDiDeSkQB8YiRHurYVCfyAwYoK7gRKey73K6NcL C5f4FpxZK5X5C4MmLV6vHvc0GWrom8fxiDHhICq8VQPQLA/AU7zOhcDDnEyJAwEEK667 ti1Q== X-Gm-Message-State: AOJu0YyRiaIUpjc0HiMTOaBReBTo8GRuGxBHAIGCcwY8XOQ6nYfIkOxF 4Jsf8d6LRfTHssypNs/VVlTQNc5EjJMFG87onJrKYj3SE0hzarbFxReRgKm9cr3OTqRNS8gebR6 wetTOK822UOT6t/vQEmXjCLq/Rko= X-Google-Smtp-Source: AGHT+IG9PrfzAUlMNREu7eDXF5M0e4D1RXHYG52hVS03dzpN6ejsigkwMh9ZQYGjeEqn8AuxfrrndpSQNbBPVUetuP4= X-Received: by 2002:a05:6e02:58f:b0:363:8f08:5831 with SMTP id c15-20020a056e02058f00b003638f085831mr3093171ils.19.1707234885301; Tue, 06 Feb 2024 07:54:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 6 Feb 2024 17:54:34 +0200 Message-ID: To: =?UTF-8?B?0JPRgNC40LPQvtGA0LjQuSBTZW5pb3IgUEhQIC8g0KDQsNC30YDQsNCx0L7RgtGH0LjQuiBXZWI=?= <6562680@gmail.com> Cc: autaut03@gmail.com, PHP internals Content-Type: multipart/alternative; boundary="000000000000e2fe450610b898c0" Subject: Re: [PHP-DEV] Feature request: https://github.com/php/php-src/issues/13301 From: arvids.godjuks@gmail.com (Arvids Godjuks) --000000000000e2fe450610b898c0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable JavaScript is JavaScript - it's not a good role model to look at. If anything, JavaScript is a collection of things of how not to design a language :) What you are looking for is Golang. The level of changes you are proposing require it to go thriugh an RFC process, have 2/3rds of voters to agree to it. Tland that is after a feasibility study is even done - engine might not even allow to implement such thi g and require exte sive modifications for a thing that should be done on application level to begin with. And memory usage is one of the biggest points against it - engine allowing to store I side it arbitrary data that is logged by application on a per-request level is just a bad idea. People will shove megabytes of logs into it in a loop and them file reports "why is php using 2 GB of RAM?" - this is literally a daily question you get woth relation to Doctrine when people try to run bulk operations, do not disable trace logger and them run into the memory limit. What you are proposing is a footgun at it's finest and PHP has a rich history of those and we have learned from the experience as a community. Things like this are left to the userland. There are many libraries that help handle this. On Tue, Feb 6, 2024, 17:35 =D0=93=D1=80=D0=B8=D0=B3=D0=BE=D1=80=D0=B8=D0=B9= Senior PHP / =D0=A0=D0=B0=D0=B7=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8= =D0=BA Web < 6562680@gmail.com> wrote: > Javascript is closer to. > > It allows you to throw anything, but it is still the throw statement, > keeping in the mind the async nature of js - memory and processor stuff i= s > shared by the time. > > JS seniors usually hate those guys who throw anything except language Err= or > class because they skipped the mandatory level of programming - OOP. They > are now taking fun from it. We're tired of OOP for now. Once you work wit= h > batches/queue/bulks you need pipelines and chaining, and there's a throw > works only to stop any certain tasks and almost immediately catch the nex= t > line. So `throw` is required to be safe-shield, but solves not enough cou= nt > of cases. > > Old, maybe 10 years ago, Fowler's article about "errors is not an > exception". He explained why, but recommend to implement own error bag. I > tried few times implement own error bag on production ready code. And thi= s > is the hell of rewriting full nesting tree and carrying that return > statement to upper level again and again, then you start to get confused, > then you rewrite all return to objects with properties/getters/setters, > then you understand your PHPStorm started to lag because of 70 uses in > class... Better to use global error bag stack that you can enable or > disable for your needs outside function ("in controller", GRASP) or insid= e > function directly like old good times $errors[] and if ($errors) { return > null; } > > > =D0=B2=D1=82, 6 =D1=84=D0=B5=D0=B2=D1=80. 2024=E2=80=AF=D0=B3. =D0=B2 18:= 23, Alex Wells : > > > On Tue, Feb 6, 2024 at 3:58=E2=80=AFPM =D0=93=D1=80=D0=B8=D0=B3=D0=BE= =D1=80=D0=B8=D0=B9 Senior PHP / =D0=A0=D0=B0=D0=B7=D1=80=D0=B0=D0=B1=D0=BE= =D1=82=D1=87=D0=B8=D0=BA Web < > > 6562680@gmail.com> wrote: > > > >> - add non-breakable interface and language construct `raise` to "throw= " > >> error without collecting trace > >> - that error could be any scalar or object, or you can implement new > >> interface for them, keeping that is nested and taggable array > >> - this `raise` could be catched same way as \Throwable allowing log it > >> anywhere you need or re-`raise` again > >> - `raise` statement won't start to collapse/break code, so it could be > >> skipped without affecting application > >> > > > > Is there an existing language that does that, having both exceptions an= d > > these silent raise statements? > > > > > -- > +375 (29) 676-48-68 <+375296764868> / Mobile - =D0=BF=D1=80=D0=B5=D0=B4= =D0=BF=D0=BE=D1=87=D0=B8=D1=82=D0=B0=D0=B5=D0=BC=D1=8B=D0=B9 =D1=81=D0=BF= =D0=BE=D1=81=D0=BE=D0=B1 =D1=81=D0=B2=D1=8F=D0=B7=D0=B8 > https://t.me/gzhegow / https://t.me/%2B375296764868 / Telegram > 6562680@gmail.com > --000000000000e2fe450610b898c0--