Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117657 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70036 invoked from network); 2 May 2022 10:51:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 May 2022 10:51:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8B3D81804F2 for ; Mon, 2 May 2022 05:28:11 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,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: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 2 May 2022 05:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1651494489; bh=HzJQzcM5INJi0xZsQgX0ov2B+kobFs/iP5BwVZjxQV4=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=eHA7mUonEmhkLDp4Hf2w73JFXV3LWHkbqyoR5JoAzacsnnRVBV6yYaG8sf56tfG5w faeIHuLHDc0ZgLXWvCiScEKLlxamHv8EjaCluZLobgJPwzUfw4zniSO8xMG9djIrAs 5W1SZYy5kmmongUDcdEyqmjzjNq8o+1VMCoeSjuY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.50.96] ([91.138.46.132]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MmlT2-1oA8oJ1D1y-00jrr8 for ; Mon, 02 May 2022 14:28:09 +0200 Message-ID: Date: Mon, 2 May 2022 14:28:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: internals@lists.php.net References: <62317B01.90907@adviesenzo.nl> <3F016525-CCDE-4229-9260-7C76A6FF42E1@cschneid.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7edmUcVwluf1xQv7MbQ8FK1Ax6Srd4ef/iGmOXtQ7kcCjHj28H5 TBb3WZQF+8u24XZMxNWaLpgWUHBZma/7hpqqlNQRm3BOMvkVGVftuyB2i5cZ4kcjDSX19yE 0ueFF1kOnerqrV0e6OAEZnckLOUPYWM6HBWeg85vLZywB5qCz4bLSQmQosyTatbXaItPHKb UjmNOLPIpxPgiwklCZtwg== X-UI-Out-Filterresults: notjunk:1;V03:K0:TIoE7qsia3I=:+7nClGJUoAD9fJ6kONctVx 8rFLBg+utktTmp1ujorX8MOB3s/0Q17GhhY94DDA4KSDofjxVut1TXoE+qXSQ2hOK4Ru5QQpm R6jzak1NEgJ9TpTFDb0v7qLADDgyamWI+YJ7AaTZPl0r69vv2BWKmPk0cG4vA5d5GBi1J1cQG MwrWsKrg6GIPfk/pwP1jVbt/YasRgGRXGoWLbX1S/4ykalvKMVAesknj4BY6XPiS3PwxSiFKq qOa4no7aSMTcAV07A4NZqy7aL+Ve9RECI6tqQlS4EKEk81SsBtKx1VCOBKMB5CnBULg66tBF4 1heS5vMsGqquFA9sdeskpyOiWpRdycy2zzuLo1EVhVYNSqze7gAS4NmGHwPF9Lu4JfeA4D0Qw PQOWx80JPISkoAT3OAiKtMNq9IqnS3KJmGXm9o90xeeLts2NKLkzPiyxqh2We4KL617MQBGBa gkUGqVY2791Vc884ibPWYZ1mJ4CluD8/awrqjSlG5iU4JOB7a9R1sApvpXo0S4IEfNZQpxvp2 zWwSQSLDLxWOUVSNRedUSaoDI8LzIPrIoTGIACOIK/XEk0qrCZAOLKInBirlOxopE/Yex0V6+ G3Y5pJM7u3XKVb0Q8/d5eUgjVQDG6O8m4GYWnLSX6+L0D4CvV3VVYCtL5wsi1Yds64FKLufuJ meLOlpl1yhY2Z7IHwXP1z5C5wL+cApMgoTxrm3PAuzU3ozLGDKmMQlRDJf7dTCBw8OD/wWpDz 4Mhx4B5/KJ6q776gbOMNz7hS2lJZ7gEDAVh87q/fuUXCZyGq/hVhSVsaWSVyvyrbKkAOZyrt6 iba6Qbe3lx6YS0GtH0D2AR5KkUra3xZbdBbt3FI5e9HSLVbTXtwuvrIIGMuVaS5Sk2NDoUEMB noWI8xysHe3U6Je97iDHNdQbOP3/tnxsVwt+tYHsR0n59uwTU51jaTHmWad/TZ1UVcc/5uSlz 2N9vnpssRYijDQr1EqeCpp3Oqm5v20dAP4LT6s3fUms3qrKKzkYJHn1icpK3ztv1KwLBuHSnb wgeD2hTbsakltST99Hom8jLsQrN3dqDjOyojKKcWm5bsCaU6BY0C8eYzcKU7DZ/oFDQqqJCoq 0h1PgQzGxJoc3Q= Subject: Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throw a deprecation notice ? From: a.leathley@gmx.net (Andreas Leathley) On 02.05.22 13:56, Alexandru P=C4=83tr=C4=83nescu wrote: > The point is that this is not an usual deprecation, something that will > change to an error in the future. > In the end, it's just a change in behavior with no error before or after= . > It does not fit the "deprecation". > > As I dealt with several PHP upgrades, and I'm still going to deal with t= hem > in the future, I proposed an idea at some point on the mailing list: > To find a way to "flag" a behavior change. > The problem is that it should be something outside E_ALL, or to be able = to > handle it in a totally different way than setting an error handler for i= t. > Something that can be used when preparing for an PHP upgrade, something > like: > register_version_change_handler(callable $callback, $toPhpVersion) > While preparing for a future runtime version, it would be deployed to > production and would record behavioral changes in a logging system. > These changes need to be manually reviewed, of course, as a change can b= e > to return false instead of null and if that value would be used further = in > an if. > When using in a library maybe there could be some token like @@@ to not > trigger the handler. To me, adding another error/change handler system seems like a bad way of dealing with this, not to mention that you need to introduce this behavior in a PHP version first before anyone can then use it, so it would be years before this could be useful, and even more years until there would be established patterns and enough knowledge around it. Using the existing way of notices, warnings and errors seems just as good to me, and people have been handling those for many years. Any new way of dealing with this should have a very high bar to clear and would need to prove a huge gain in value. To me this does fit the definition of a deprecation - behavior for the given code will change intentionally in a future version, and you are warning about that future change. But one could also emit a notice, or a warning. The advantage of deprecation notices is that many tools ignore those specifically, as they are something to look at, but not necessarily right at this moment. Being more lenient in certain situations with deprecation notices is therefore a good pattern for easier adoption of new versions. I have included that behavior in my own applications, by logging deprecations separately - I will check them out once in a while, but they do not need immediate attention. Any other PHP notice or warning would warrant immediate attention, as it would be unexpected.