Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122301 Return-Path: <6562680@gmail.com> Delivered-To: mailing list internals@lists.php.net Received: (qmail 82872 invoked from network); 6 Feb 2024 15:35:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Feb 2024 15:35:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707233791; bh=zYx3Ytm63nKxyaJ1LxpG1zh11KKhB/TjSOerzlRcX28=; h=References:In-Reply-To:From:Date:Subject:To:From; b=FHJHedN8TZkCbkYBbBYeWy48F8QA/Kj2BTK1tfVLETM9UCcCK7Nqd/ldX+wS/COAg kyWXHy/n2htL/1IRu4r+8SHAvZ4hpltMS9n97OzrgtIldAtF8PW12B7oNZ1qmCapLN amiZSMwj+fT8zqNSWJmw0Q7hE4FTD1Njd/D8ODol5yzrwxREzCPNaKrBJeR9LUUNyX LhOCeHQ53ushMJHOdBo6L2DNg9qwGxo4HUFt6NmCE79EGC6CYcJeHPEUsBtQyXqTFE XW6FAgsMW4jtwEBcxi7/HFs8ByW1X+ChvSXk+gSq53JKE0yRhiy0T5TkcgB51VLnHc h4+9x7yTk9lZw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B6525180064 for ; Tue, 6 Feb 2024 07:36:30 -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.4 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: <6562680@gmail.com> Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (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:36:30 -0800 (PST) Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-595b3644acbso308495eaf.1 for ; Tue, 06 Feb 2024 07:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707233737; x=1707838537; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=zYx3Ytm63nKxyaJ1LxpG1zh11KKhB/TjSOerzlRcX28=; b=avXzriB5dk1dukCPTLit0lWMy41C0nACO3gOuKBwaQ15f5jlxIrzcD6AN4FshqKV1w p2w3ufUrVBoLuMEPxGUGwJHWYO5s74sIT/U2AWCSE0yKZJgfx3otltNPLht/Pbf7mvIx 97ScJY9MQ4AHMH1DFhXw8MebPGlk23AFGosiINsWS+ulKKc130j4mSxcX40VJXDVaaV1 s7eEfYAexr9Nv+4PL5FRGw6ZAu3LWF3qpi+sDi+7cNInpHvBvhmTdzLVFNZcpFofRKkt yrpO9YUXiTVCrqU03FHBgahd44MxKwFDqFoE/OLOxbzmr8hSQrwggVrAJyC3o8Z012Sh /uNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707233737; x=1707838537; h=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=zYx3Ytm63nKxyaJ1LxpG1zh11KKhB/TjSOerzlRcX28=; b=i3f0dYXWvuEFm8ZnNFg/v+GgcHxQNyJ8iqx758K+QWKFSy4xjJFTj6mHKODYIsMllH tcIWbH7w6Vna3timhiF9Xo/dEbrQyNiOPLiCuLgIy0hlNQPMBBHE1tRosXuthkCJvYT6 DjWw2/Qx+aiqYhjsIMstLzuH3Uoy817EYsdwFaXOnjCgwoolqRKV2zENPcKB5oBKBXKc LzaZ4eVO3zWk4Lrz5E5nXnQMsgz0i5zMRLNgaQQ11F0gzWHbXNjbpfPdslaZJ49sjAHF eSx4RmdKa2831IUhoGOwRb0GYIWksJS1P0LS6XOYwUk8q232qrsK1KC+j9/kbKt7R/06 2uvw== X-Gm-Message-State: AOJu0YzxAaVDs8jYFbBug+QSNEdJAA6PZEBHrGieKD36fCV256164leJ 4+TO3S90LKF1dhkRoLdCp5hfsmmc8gYeFM/b84xS8/xhdqNQ7f7LM/2ltSMTyz+1P9mUm/4GYwS AwTJ71dby6lrvXKp2vj+2T0nfxpg= X-Google-Smtp-Source: AGHT+IGH5Kb188feIsaDLaWsutJkToRdQAC+ZwHssOOlyck7W2oyClN/Z96vuwRIGTVDM3seZqdRHYzkSnAX+nI9noc= X-Received: by 2002:a05:6871:54e:b0:218:9374:7f7b with SMTP id t14-20020a056871054e00b0021893747f7bmr4517853oal.8.1707233737518; Tue, 06 Feb 2024 07:35:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: =?UTF-8?B?Yg==?= <6562680@gmail.com> Date: Tue, 6 Feb 2024 18:35:01 +0300 Message-ID: To: autaut03@gmail.com, internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000007933230610b854e3" Subject: Re: [PHP-DEV] Feature request: https://github.com/php/php-src/issues/13301 From: 6562680@gmail.com (=?UTF-8?B?0JPRgNC40LPQvtGA0LjQuSBTZW5pb3IgUEhQIC8g0KDQsNC30YDQsNCx0L7RgtGH0LjQuiBXZQ==?==?UTF-8?B?Yg==?=) --0000000000007933230610b854e3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 is shared by the time. JS seniors usually hate those guys who throw anything except language Error 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 with 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 next line. So `throw` is required to be safe-shield, but solves not enough count 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 this 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 inside 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 and > these silent raise statements? > --=20 +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 --0000000000007933230610b854e3--