Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122337 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19385 invoked from network); 8 Feb 2024 04:27:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Feb 2024 04:27:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707366526; bh=UufOdeIACrtCFep9EBXOv5IBwDI+xmYSvMSwrW2XM7A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S9z6CrLJa7SOHYsJH0E5ARFR2bGc23Y3MnLzLsV9D+x2HT9v+QBTVQzujHsYOg8HX H0HuESbGF78WJ/466QZzs9cHFDmMc5rSD8qrACDqMNnOMiUqdnrhPQ8Zf1Wf2nM9iW Ho3CGtUaVjj0EAlOEfmZxzGfU7qR9HErn6Ye7xH5hX62S+a2Grcht47zQpgUQ4a4qs Bn3bxawdiMUkvIAhnSowx3gdbvUo77GElGt7bzSjyMdW5jWGqTCTq5S/eHTlXvJJMw cH+92VdpeVotwehR2tCtHLVtSs44nUjycGZmRhExKnYJRjgnS6hHQD6d9hxiQFMK5k 3J/rkQovi62IA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 54EA2180069 for ; Wed, 7 Feb 2024 20:28:45 -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=-1.4 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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, 7 Feb 2024 20:28:43 -0800 (PST) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-6049b115630so3872787b3.1 for ; Wed, 07 Feb 2024 20:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interi-co.20230601.gappssmtp.com; s=20230601; t=1707366470; x=1707971270; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4GoFF9kw0Rj+zAoVwiPBv1cu7qHcC4C9DvrOF6LtmPI=; b=y5viyU0PPH06Px7nXNYFavJ6EP5tG8/5Qb1PCJoCLj/77TRzfBBNQzZAUMWIecHyXq uVQ/T/ML5VkA0A34gK48bXp9iEaQ7pSvP6r10PQjYyorS//tID1villhBc4adFyB7S8v eqDL8PvlAyskJzpuuxOlXd4Q0ao2DLYuC0pDHxKKwZeTekzbq6rwwkse3iu+V+25wvF7 5Gr5eE6Q4S6qMA8+4q1jvqr1C2SKBWxi4VsLUOtwVSbLCmQVd9svT235wN/2mBhoP9Dh qX2yl0LI08B8OX2VvcZzqP0yTCAYJFJdNK9qEmWGqPiOfC4UMCQStGtDKxmqISfFBEbk t/IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707366470; x=1707971270; h=content-transfer-encoding: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=4GoFF9kw0Rj+zAoVwiPBv1cu7qHcC4C9DvrOF6LtmPI=; b=BE4M5KgbGJyzlxbG0LCGXNXDyLl0BAm9k9wr0OcROTc/R7UmAd58oJ2Mk6UBwFOUtB kqlW7TxLsiyyEl+aEv2/XogiYvJWaaBsmQVRpX8aKlaulgJIa9BR3enrYHGTFFLTLz7d bFv+sTQkMTk4XRJOWkT+mdG2qkS1ubB0XMJwoFBJp6IkEL7HvIjEcqNqoBjr8J45ghC2 A6A2HSfc+Cb6Rlbor1UJwSuxgXPoczn+B7AhWqCthrn0NxcW85jMk757iWL/z2hwxjnn lDq8SpvCI4hZLdghZspQrGZuk0VcpfN4K4wIssKOmi7WPq2/61GXa5FMW//9YtIgnoTf kubA== X-Forwarded-Encrypted: i=1; AJvYcCV8V8nnKsC2l0Q8Yjtn94RbUJHKF5/uuYx81lgPxzcwz227Ve6rJBUlSsnRe05QzhBYHELXN6XqUieqBboyHOPignQMI21WyA== X-Gm-Message-State: AOJu0YyeGiFOWbdJfKPTVrsr3lOwHhIoalUbRIByHCsJ2JPhrWkBMYEZ bwDta0+p2eDh3RheNxXk4o0fKNVg6IDzdrIcjidNKTLUsycC7AWXkOQisfeSheMsIQHLyv69Lwv ByXGO/oJBG+Gq6X3xg4YjJbqN6tC7nk9xvv2xNg== X-Google-Smtp-Source: AGHT+IEFOCZvyeClbsyr1H136SdGT/9MJB/NVKNFwTl3eRegFp05prLZcKkyeSroxeWOx2tw+tp0cyCWUB342jjO720= X-Received: by 2002:a25:e4c1:0:b0:dc6:c670:c957 with SMTP id b184-20020a25e4c1000000b00dc6c670c957mr1034204ybh.32.1707366469892; Wed, 07 Feb 2024 20:27:49 -0800 (PST) MIME-Version: 1.0 References: <742f202d-7990-4f51-b903-7a15e3fd33c2@app.fastmail.com> <1cd8fa7b-ab62-4563-bf13-bb7801f1ce8d@app.fastmail.com> In-Reply-To: Date: Thu, 8 Feb 2024 13:27:39 +0900 Message-ID: To: =?UTF-8?B?0JPRgNC40LPQvtGA0LjQuSBTZW5pb3IgUEhQIC8g0KDQsNC30YDQsNCx0L7RgtGH0LjQuiBXZWI=?= <6562680@gmail.com> Cc: Larry Garfield , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Feature request: https://github.com/php/php-src/issues/13301 From: alex.pravdin@interi.co (Alexander Pravdin) On Thu, Feb 8, 2024 at 2:29=E2=80=AFAM =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: > I still don't understand why the problem is signature and moving a simple > throw statement to return type, and then rewriting the catch statement to > oneline-r. Sorry for answering not directly to the citation. But from my personal opinion, a static analyzer like PHPStan with the highest level of assertion will show you the vast majority of issues in the code, potential errors, warnings, etc. Just feed your code to it and fix it. Why do you need to collect errors and warnings on every API call? Edge cases are called edge because happen rarely and you can react to them successfully with proper error monitoring. This looks like a bad design of the app and of the monitoring tools that you propose to "fix" with bandaids in the language. > This is where the so-called SOLID came from, which forces > everything to be broken down into molecules instead of first closing the > problem and then deciding whether to break it into parts or leave it that > way. This is called not SOLID, this is called a good application architecture. When an application is designed properly, the delivery speed is always slow in the beginning. But later it allows much speedy deliveries because developers don't need to refactor large parts of it on every new feature. And don't need to rely on bandaids in the language to save their butt from burning because of working with shitty architecture. It is always easy to write down some piece of shit just to close tickets and fulfill initial requirements and don't care. But I still don't understand why you keep asking the PHP language community to do your job and fix your application instead of you? -- Best, Alexander.