Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120529 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66463 invoked from network); 5 Jun 2023 13:27:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jun 2023 13:27:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B25B3180089 for ; Mon, 5 Jun 2023 06:27:40 -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_H3,RCVD_IN_MSPIKE_WL,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-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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, 5 Jun 2023 06:27:40 -0700 (PDT) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-53f70f7c2d2so2484081a12.3 for ; Mon, 05 Jun 2023 06:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685971659; x=1688563659; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NOCV6ipK1cWG3DqkauEP0hRsoqoQZaYX9aBocXfQzJk=; b=n6rqQ4jPLWdybtcYKXCmOXX7nCl0cUiBrPp3P89TMB3eeYjJE25XSkjnjczc33a+sZ ehMpkIVG5cxPg5k2Uo7G77KI2gL4q1EDQTrr8b8LbANco01Cdti7zdigh7GVACdxvYO7 AKU7hsxoOEyi1XNS3Ev4KI9vmukUl3KD77LhWidasTQCNhLB8+Cr1YlFYq3AQG9kOjwL /kw4Bo8NdFiBf1CHYSrrJCtC4IIPNzRK/NlHewuA8mq5rvqUUIRGvDBe5wqzvIU4tpiV xjQR99SPKkJjaXCrUERRu/UjQ9/Sg9tmnIF0oQeiO3T+BRkkBGIpKgN/NO/UMJzmV/Lh l1pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685971659; x=1688563659; h=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=NOCV6ipK1cWG3DqkauEP0hRsoqoQZaYX9aBocXfQzJk=; b=YhgP2eftt3yb+xIgjEqgU9iJfTi9uGZOPHqmAQ8GkOTf5t/ZnVOpwZBuwB0YkgE5Ks iih890sFNiFUVlLF6a9tmdXZYFa2VNlkdJHWrDWaXcxJmoo4TLOzyw1LByUFWYFm97yK iGGYwnRQwFkLR1I4V+JHjH0i8MKSDQbvxmMsJaiZB4VmZZONzafjyYCHSstFreTOFYGZ 41qHD9XojYKA1zprnQb5iIFJ9lj4t2BO/6ePZ2VjYV8GZTnkd2c8GsQFmbcl/0Zt8XRU U1doebWaf2x+wRKj1OSgh7DPFYCl+u8pp6F6tqG5RGE0T8NZ2QMHnC13TRm3CqOgjK1+ MQcA== X-Gm-Message-State: AC+VfDyRkzRVQkOHF7BPopn+eSr5lsGf5C6G04qEO1PGi1NI/3NRHtoP FWmO3dK9z0D3kgXLpvdcsqke3by9+ysm8+6JGWE= X-Google-Smtp-Source: ACHHUZ6jxhc8/cYj+D2YlvAce9Y5uPjG9BvpW8B2oZ+E5wlVykqbsBp+AK8h8eWXKLHK+8T4Pnto61vPB+HQruB0D3s= X-Received: by 2002:a17:90a:5297:b0:256:22e:b93f with SMTP id w23-20020a17090a529700b00256022eb93fmr2553188pjh.18.1685971659224; Mon, 05 Jun 2023 06:27:39 -0700 (PDT) MIME-Version: 1.0 References: <5798AD17-3FA6-48E5-83E9-B5773BE94598@gmail.com> <71F586BF-E5AD-4FD2-B680-6E0EDCB4733D@gmail.com> In-Reply-To: <71F586BF-E5AD-4FD2-B680-6E0EDCB4733D@gmail.com> Date: Mon, 5 Jun 2023 14:27:27 +0100 Message-ID: To: Claude Pache Cc: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000d97aa905fd61dd35" Subject: Re: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures From: george.banyard@gmail.com ("G. P. B.") --000000000000d97aa905fd61dd35 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 30 May 2023 at 09:54, Claude Pache wrote: > Any change that introduce a BC break or a migration burden must be > justified. (There has been enough rant around justified BC breaks, so let= =E2=80=99s > not introduce unjustified ones.) > > What is the purpose of changing the return convention of IntlCalendar > methods, and is it worth? > We are talking about adding a new method here, so I don't really see how this is a BC break. One would hope that people do not just blindly change function names, especially considering that one would need to look at the migration guide, where it can be explicitly noted that the return type is different from the previous method. Moreover, the return convention of IntlCalendar (and most other Intl classes) has for the most par always been wrong. Prior to PHP 8.0, passing invalid types to functions/methods was considered undefined behaviour, and in general the value returned when a TypeError wasn't thrown was NULL. However, Intl (and some other extensions) didn't follow this and returned false on ZPP errors and always true otherwise. As such, the change to *always* throw TypeErrors on ZPP violations has brought to light those sorts of extensions. This was one of the main motivation to add the true singleton type other than consistency, as this allows tools like static analysis, but not limited to them, to detect dead code and bring this up to people's attention. As effectively, there is no point in storing and/or comparing the value of a method/function that always returns the same value (be that null(/void), true, false, or other). Considering this fact, that one should not compare the return value of most (if not all) of these methods, using void as the type seems very much appropriate rather than using true. Best regards, George P. Banyard --000000000000d97aa905fd61dd35--