Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117342 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26383 invoked from network); 16 Mar 2022 04:27:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Mar 2022 04:27:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D7EF61804B3 for ; Tue, 15 Mar 2022 22:52:23 -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=3.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL, STOX_BOUND_090909_B,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS36483 23.83.208.0/21 X-Spam-Virus: No X-Envelope-From: Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 15 Mar 2022 22:52:22 -0700 (PDT) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 06D0D461C3D for ; Wed, 16 Mar 2022 05:52:22 +0000 (UTC) Received: from nlss2.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id E843F46103E for ; Wed, 16 Mar 2022 05:52:05 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from nlss2.a2hosting.com (nlss2.a2hosting.com [209.124.66.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.102.3.17 (trex/6.5.3); Wed, 16 Mar 2022 05:52:21 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Name-Gusty: 7dde0d604ce09635_1647409941269_1386905575 X-MC-Loop-Signature: 1647409941268:2396358593 X-MC-Ingress-Time: 1647409941268 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:MIME-Version:Date:Message-ID:To: Subject:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+lCzA/nsYKmvWSruTuCrc0P4DUeB36uw8EDiLlv53Rs=; b=Ia+v9uhsIbsqVGDcXAtl8f8HUT K0hhzM14MLGjBuM/32RJQBIWrTW7oE8RR+JkbTqwdUeUqJ3bbMl3IDf16r2Nw15pmtRtsv/Huv3E4 Rko3Z7pcF8ZNuwLOnN6fVpHtFH4yaEl05oaCwv1c31jRmGrTzsqHSPYrEAtEK8HEPO2U=; Received: from 86-154-178-143.ftth.glasoperator.nl ([143.178.154.86]:55863 helo=[192.168.1.104]) by nlss2.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nUMZm-003ZFN-76 for internals@lists.php.net; Wed, 16 Mar 2022 06:52:02 +0100 To: PHP internals Message-ID: <62317B01.90907@adviesenzo.nl> Date: Wed, 16 Mar 2022 06:52:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------030107050703070500040206" X-AuthUser: juliette@adviesenzo.nl Subject: Deprecated partially supported callables: should is_callable() throw a deprecation notice ? From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) --------------030107050703070500040206 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit L.s., I've just been looking in detail at the Partially Supported Callables deprecation RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables The RFC explicitly excludes the `is_callable()` function and the `callable` type from throwing deprecation notices. > The |is_callable()| function and |callable| type remain side-effect > free and do not throw a deprecation warning. They will continue to > accept these callables until support is removed entirely. While I can fully support this for the `callable` type, I wonder if the decision to not throw a deprecation on use in `is_callable()` is the right one (though I understand the desire to keep it side-effect free). Consider these code samples: function foo(callable $callback) {} foo('static::method'); This function call not throwing a deprecation is not problematic as in PHP 9.0 the function will start throwing a TypeError. if (is_callable('static::method')) { static::method(); } The second code sample, however, is problematic, as in PHP 9.0, the behaviour of this code will be silently reversed for those callbacks which would previously result in `is_callable()` returning true, which makes this a potentially dangerous change without deprecation notice. Would anyone care to enlighten me as to whether this was given due consideration ? Smile, Juliette --------------030107050703070500040206--