Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120389 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31576 invoked from network); 22 May 2023 21:32:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 May 2023 21:32:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 043BB18004D for ; Mon, 22 May 2023 14:32:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 22 May 2023 14:32:31 -0700 (PDT) Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3980c92d8d6so922561b6e.0 for ; Mon, 22 May 2023 14:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684791150; x=1687383150; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=tt0gV5KnyhN1x6YoUZE+hgU17uCZR40/xYslDBBpGrc=; b=bChwbi2sMv6aJjv/St9RjrZhYOUqHuMSzNtLtfknsF0+xbVq5cAkcPUEGEgkcaSp6q WpjBMHlHRukDQk2TOa6iIMInqLOpTYWFYaNvypV84WAV5qtoFy81XPaVA9R1YI3Xshu3 PjkpAcxbfKClAK9ux/HwajTVHn1fznCWo5JFMb46gzcG+5S9SqRVn5NCmi7cqne/EIE6 4pmOcmr2/ciamwaqb5FNayJUOGO3aCktQR7YniUaa1mMc6HeRkw6vdR2DWsLJeAX4BQ/ 7Qtq27HoSJOuCv7MLf1krBHN9KhXFGk9T7mcfQ7qS/YraizDQisSGFAYeYx/RE54r5Xk 5vAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684791150; x=1687383150; 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=tt0gV5KnyhN1x6YoUZE+hgU17uCZR40/xYslDBBpGrc=; b=a5BF+k9la84MZOGniJGu1hsYgCPOO+CNJrKPQUovii35acUjqlIRUNmQAGY3CWC9et FsIylSjVrJW4vPGpdaCWqMTZHDheQWNCWcX6WuYVu9fl7GWcp6p/DZXFFruIarD9QY1r ohjMfdo1sIWx+7S+NROXtp8Jx7TA2HN1gIRIRrjOYlLF8ThQ/NKXXVMLaSYE5l/KcluE afKty8ExCjn4HdBHuDQALDf1AjWNsvARzgjrW6VDeUvcIJYDH+jg2zK4Xtut/ii/Rue4 0OFEhpdE+7qZmL1lLHp7BYCuqXEF6M+bsukj7+pUrNlFuf+9Dud432Gr78+QJHxlYDUT 0z1w== X-Gm-Message-State: AC+VfDzD4aD98EFEJsJODSHB6lyga3cOA5Q+OLcsjNo0y4rs1savLSXE PDFAEgmC/tPLtBCooKAXzdWn89z+SsMbyPp/nBwFFqv0tBE= X-Google-Smtp-Source: ACHHUZ4Fj6c2MPAv9cENH/TTunWP5BOlLDStz9mqgAo7gkgMEGrw9Nj/nilcMcsZ040hJfxtS2iqR+t/dEOJEmNY6+M= X-Received: by 2002:a05:6808:2d2:b0:38b:8acb:3245 with SMTP id a18-20020a05680802d200b0038b8acb3245mr6126471oid.13.1684791150499; Mon, 22 May 2023 14:32:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 22 May 2023 22:32:19 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000000bdcf105fc4f0216" Subject: Re: [PHP-DEV] RFC [Discussion]: Marking overridden methods (#[\Override]) From: davidgebler@gmail.com (David Gebler) --0000000000000bdcf105fc4f0216 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 22, 2023 at 1:01=E2=80=AFPM Dan Ackroyd wrote: > Even for those who use static analysis, most (afaik) don't have it > running constantly in local development and this RFC would prevent > people wondering why their code is behaving surprisingly before it is > static analysed. > It takes care of one possible surprise they might encounter as a result of not running static analysis of their code prior to runtime. Just one, out of dozens of possible types of inference which are done by static analysis checks and could hypothetically be done by PHP at runtime. But I'd question whether there's an appetite out there in general to start adding all sorts of new runtime checks, which I would argue means any new runtime check warrants the utmost consideration of cost-benefit. > Also, not everyone uses static analysis tools. > That's because PHP is a dynamic language which doesn't have an explicit compilation step and by extension where static analysis of any sort is optional. That's my question around the benefit with this RFC; either you use static analysis tools as part of your PHP workflow, because you care about that stuff, or you don't. If you do, you don't need any new error or warning emitting behaviour added to the engine itself, you just need PHPStan / Psalm / IDE / whatever to flag it. If you don't habitually use these tools already, you're probably not going to be annotating your code with #[Override] anyway. My wager is the kind of people and teams who would be most interested in using and would benefit most from an #[Override] attribute are the kinds of people who are using static analysis tools and probably have configured PHPStorm / other IDE of choice to run those checks when a file changes, or via commit hook, or build pipeline, or whatever else. What I see here, then, is a perfect candidate for a userland attribute. Anyway, usual disclaimer applies; I'm not a voter on RFCs, I'm one man with an opinion, my opinion only matters insofar as gathering a range of community feedback matters to the author and interested members of internals. -Dave --0000000000000bdcf105fc4f0216--