Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120685 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91298 invoked from network); 26 Jun 2023 19:43:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Jun 2023 19:43:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DEDEA1804B0 for ; Mon, 26 Jun 2023 12:43:26 -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-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 26 Jun 2023 12:43:26 -0700 (PDT) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-98e2865e2f2so50478366b.0 for ; Mon, 26 Jun 2023 12:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687808605; x=1690400605; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:user-agent:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=wZWrlLFE3vt06/gpIb60AhVJzO+1ZItqlxcAUFSpoYc=; b=enpOs9y6dWYXXgldEjFeO0TM7y2f8nPJ72ZKJHLhz4umzMf475PXjoRYbxRQMhcfry iR+p7DRZR/wFSs/4FjWd7iCjeAu1puAEc4iIzMYFLuQU3z5OLFMLV9WC0e3N5NtgO7q9 bTj97nRAux51TngYcZj9UebYKQ4E7vMO9E/sev55n5cFsk/y6Qi0mlGYsX3OWgFSyvwP IV0iw+HMytX7olAIuxQW+3P17soJF0PCPMIcTc1fBZ3N/HsKQLCu7cJAFL/07AJSwXpX uk6FEh7uRgYmNZ3DHUTB8YuHcX5yDY+oB8zX9HZ7QeQ1/WfdLrbkodFY7VDxxdBdQMlG EPBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687808605; x=1690400605; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:user-agent:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wZWrlLFE3vt06/gpIb60AhVJzO+1ZItqlxcAUFSpoYc=; b=esREChOasi9by3Y1fVXrkC9NY9ghD86lFaJgB0qF0P/wrFFbj7uKlRgDSgjahAgSej w6e2Zt3nYDjh5NLwhCSp75cLjsL/nFsQCPwYdzSOpGUVm3kSv8e5eW2VM+wWkOCbmqPZ eMGZNoVZ5WtDKTlFXnE/aE4lKMcilGbTWA8oyJ9n5vU+2ZhgTchqVpgFUgUF+8JkC78i kprw2AzVuKgplmPXUF69dDKMkuyMZ7BNUhSwC+n1O0XQT7gf7JxBen+EhLjhlvmoEENp jKfL9gWltyPLrLTh9rkdNEtetOoACMF5Nb0aMX3axlXp1C7GsJmpl8uCCxMtBEGDSebj qbWA== X-Gm-Message-State: AC+VfDwptxrXVAL3B4bhEOVgO2T4uDm02GMMJMzmPn4FTkPx5MOdbHIn 4otiNuyVAicTW9JikolIs78= X-Google-Smtp-Source: ACHHUZ5ZLEGJecOv94VjeYyeKN0m6qwv3MfuV2HdXRRAOpz9Bt/fWYEugsfa5QirYSSgPh5l26hakg== X-Received: by 2002:a17:906:77d5:b0:974:5de8:b5ce with SMTP id m21-20020a17090677d500b009745de8b5cemr12846ejn.2.1687808604713; Mon, 26 Jun 2023 12:43:24 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id x20-20020a170906805400b0098f9904804fsm1904844ejw.110.2023.06.26.12.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 12:43:24 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id EC1F227C0054; Mon, 26 Jun 2023 15:43:22 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Mon, 26 Jun 2023 15:43:22 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeehfedgudefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesrgdtreerreerjeenucfhrhhomhepfdfp ihhkihhtrgcurfhophhovhdfuceonhhikhhithgrrdhpphhvsehgmhgrihhlrdgtohhmqe enucggtffrrghtthgvrhhnpeefffdukeegjedtkefftddugeethedvgefgkedvleeiveev vddtueejffevfffhtdenucffohhmrghinhepphhhphdrnhgvthdpvgigthgvrhhnrghlsh drihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep mhgrihhlodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufedufeeludekhe eiqddvheekvdegheeikedqnhhikhhithgrrdhpphhvpeepghhmrghilhdrtghomhesnhhp ohhpohhvrdgtohhm X-ME-Proxy: Feedback-ID: id4a9467a:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4D8A231A0064; Mon, 26 Jun 2023 15:43:22 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-499-gf27bbf33e2-fm-20230619.001-gf27bbf33 Mime-Version: 1.0 Message-ID: In-Reply-To: <6B872612-2F31-49E0-949C-CDF6FB2B9BE4@benramsey.com> References: <6B872612-2F31-49E0-949C-CDF6FB2B9BE4@benramsey.com> Date: Mon, 26 Jun 2023 21:43:01 +0200 To: "Ben Ramsey" , =?UTF-8?Q?M=C3=A1t=C3=A9_Kocsis?= Cc: "Levi Morrison" Content-Type: multipart/alternative; boundary=5240c3b904b242ff9fb5d5874c55240a Subject: Re: [PHP-DEV] [RFC] [Vote] Deprecate functions with overloaded signatures From: nikita.ppv@gmail.com ("Nikita Popov") --5240c3b904b242ff9fb5d5874c55240a Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 26, 2023, at 20:22, Ben Ramsey wrote: > > On Jun 26, 2023, at 08:36, M=C3=A1t=C3=A9 Kocsis wrote: > >=20 > > Hi Everyone, > >=20 > > As previously announced on the list, I have just started the vote ab= out the > > "Deprecate functions with overloaded signatures". > >=20 > > Link to the RFC: > > https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatu= res > > Link to the discussion thread: https://externals.io/message/120146 > >=20 > > The vote is open until 2023-07-10 16:00:00 UTC. > >=20 > > Regard, > > M=C3=A1t=C3=A9 >=20 >=20 > Clarifying my =E2=80=9Cno=E2=80=9D votes=E2=80=A6 >=20 > I voted =E2=80=9Cno=E2=80=9D on `array_keys()` because I do not see th= ese as two different function signatures. To me, the single signature sh= ould look like this: >=20 > function array_keys(array $array, ?mixed $filter_value =3D null, b= ool $strict =3D false): array {} >=20 > I voted =E2=80=9Cno=E2=80=9D on `IntlCalendar::set()` because it seems= to me that `setDate()` and `setDateTime()` could share the same signatu= re if `$hour`, `$minute`, and `$second` all default to zero, like this: >=20 > public function setDate(int $year, int $month, int $dayOfMonth, in= t $hour =3D 0, int $minute =3D 0, int $second =3D 0): void {} >=20 > In the same way, with `IntlGregorianCalendar::__construct()`, `createF= romDate()` and `createFromDateTime()` could be combined as: >=20 > public static function createFromDate(int $year, int $month, int $= dayOfMonth, int $hour =3D 0, int $minute =3D 0, int $second =3D 0): void= {} So commonality here is that these are all arity overloads. I think there's three different kinds of overloads in involved in the RF= C: 1. static/non-static overloads. Support for this was dropped in PHP 8, b= ut had to be retained internally just for that one usage in FII, so gett= ing rid of that seems quite high value. 2. type/meaning overloads, where certain parameters change meaning entir= ely across overloads. These are incompatible with named parameters and r= esult in very unclear function signatures. They only become intelligible= once split into separate signatures, which is not something PHP support= s. Removing these is also fairly high value. 3. arity overloads, where behavior depends on number of parameters, or c= ertain parameter counts are forbidden, but the actual meaning of the par= ameters does not change. Equivalent to a func_num_args() check in userla= nd code. I think these arity overloads are pretty harmless. The function= signature is meaningful and compatible with named arguments. My overall inclination here is to vote No on all the deprecations that i= nvolve arity overloads and vote Yes on the remainder. Possibly I'm missing some kind of complication that the arity overloads = are causing? Regards, Nikita --5240c3b904b242ff9fb5d5874c55240a--