Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117655 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62601 invoked from network); 2 May 2022 09:38:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 May 2022 09:38:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AC153180053 for ; Mon, 2 May 2022 04:14:55 -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, 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-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (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 04:14:55 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id w187so25453744ybe.2 for ; Mon, 02 May 2022 04:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=OK9YM/seFBugn/BmJHytKPtGuqYloDFPjdoSdmCAysI=; b=JTXlaXR1OykVYcg/QHS3MZfpNZ3dQ1I0f412xjyZT4WtmVwANNLe5BjUR/E9IriBLj VhqfibHiLhxj5SARnDamKzbSQ3BQjftR7LlkU2ZK255Ig5EZrX+NqHW/JKysp1LGqaCz Ue5RIlCz4/BOV3AVsLqQDWjk41iGDNoEy0jbMcWdyD6/YlCEX0aFenWyh64WiZUJHalZ +jVSnWtLsUDXDU1bv1lqOSHD5KhfXG3Sx8B8+nLU04uOcAqpRXjpX3+L2gOdoDWR6RmC 499IdanqUW99iFt9EewXFu3m6cnUdx076bjcS1nWvP/sId+vgrJ4av2lV/vzckfYPDaq +tOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=OK9YM/seFBugn/BmJHytKPtGuqYloDFPjdoSdmCAysI=; b=Qq27X3MthfUwzGb6eyCJk97Rldyl4xgiKwGQQsh3dNqQ4RrPZdAeHcxSfIteC7FYra ghAQ5htwXe+0GhqOjl1TXiNj/MnJUW+8bCeDbwFLtCBYugF8vgzf74XIFLADHEUcyn0K ZwHt5GlW2NxRchPDcYcyR24kseCLexmzn27quuJQdJ5NZXghUTv3NmwWL2K4FzcHUrcB aS+E1ZFJ9uOv9QB9H4wOjI74NzxxSgqK7YxUT7AxojN5drKdZFG/JX/878bmG8Z9EZdK yksSlr09LbnyuWU7XL9q18mj9GXnn5dR5w7ica2IPObXODEi1fJcqDo0tE3eiYFVt3lr fjfg== X-Gm-Message-State: AOAM532QXhXPydBNzKeIGDQ61ZSZbO6NzxKom5HtMR9VyvH7FukT+iee rrxQHbCVjcy4IFUBJJ3JGdtl8KubvOkKyIjhfx5TfHMhdQ== X-Google-Smtp-Source: ABdhPJzj98bgT1WHxXpmAGqgfY+ZV5oiogCA/q6+/UxG4+vqr3YEzmWq9c9Tl7OLzvZdf5NjNxqdqYCN4A8PkPFhICE= X-Received: by 2002:a25:ec0d:0:b0:648:480d:7c08 with SMTP id j13-20020a25ec0d000000b00648480d7c08mr9833670ybh.206.1651490094755; Mon, 02 May 2022 04:14:54 -0700 (PDT) MIME-Version: 1.0 References: <62317B01.90907@adviesenzo.nl> <3F016525-CCDE-4229-9260-7C76A6FF42E1@cschneid.com> In-Reply-To: <3F016525-CCDE-4229-9260-7C76A6FF42E1@cschneid.com> Date: Mon, 2 May 2022 13:14:47 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throw a deprecation notice ? From: guilliam.xavier@gmail.com (Guilliam Xavier) On Wed, Mar 16, 2022 at 9:57 AM Christian Schneider wrote: > > Am 16.03.2022 um 06:52 schrieb Juliette Reinders Folmer : > > 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. > > > > [...] I wonder if the decision [...] is the right one (though I understand the desire to keep [them] side-effect free). > > > > Consider these code samples: > > > > function foo(callable $callback) {} > > foo('static::method'); > > > > [...] in PHP 9.0 the function will start throwing a TypeError. > > [...] This is a major problem because code which was "just working" directly goes to a TypeError without a migration phase warning about it. This is something I've repeatedly advocated against. > > > if (is_callable('static::method')) { > > static::method(); > > } > > > > [...] 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. > > I agree with you here: Code which silently changes behavior is also a migration hassle. Hi, I too would rather have "extra" deprecation notices in 8.2 than *sudden errors / silent behavior changes* in 9.0 (for the callable type declaration / the is_callable() function)... Regards, -- Guilliam Xavier