Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114096 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70299 invoked from network); 22 Apr 2021 08:34:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Apr 2021 08:34:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E340A1804F3 for ; Thu, 22 Apr 2021 01:37:49 -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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 ; Thu, 22 Apr 2021 01:37:49 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id l22so43522891ljc.9 for ; Thu, 22 Apr 2021 01:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fy+eyyCtDcDq/dO/GDYtpUW84aHeDSCT138yo97Qq7A=; b=Tctew2IhjAUZ8rE4ra7LVFIPAB3VBmQYDYyEqJA4LVEOVL00xWVOxBTvAX1gNp8EvN Ubyq8u8jylCswF1ecf9MLQuhgbbP+ALOaaqw2ItnFi6CkpT8mMcKmINoU8m1vh5Bxc6A IjH9zOPEBneTcI+2AnNjmQO3bbR0saNiXit7bGEaC8V0CXmhbk7upnYjCR0U4XEn1NxF eSLTCyEruvc6sIr70jH47VE5Ur7lErmDo0gSsc2nJsyxnvSwAr/VlSWEfSvxBixPYqi8 6H537EEBrjX74M1HlIMzupwvAqVQld/xa2BAAWVOneOVbER/+T4bgcB8yAHBG+enzBa7 6JNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fy+eyyCtDcDq/dO/GDYtpUW84aHeDSCT138yo97Qq7A=; b=qlvRkwEplpxOl/GI13OhsXdjH5dpLBYsWjuCpIgmqwYXvTHHq9RHGPFwaRP5yvivm/ UO2V6bRge7Ma4gPX34WgoOE16BRKgeMZRUeIiKZtQDMLfBSpHHmtfhQDEPAcpVIjPoCG GgCeJqowbIQl6PONarrDwX22sNXyOzBjk7+CJqvfxRRvfHnBVfz27cM+spMoOmuVPpQq G+Tw4e8OladcP/ldC5qGcVs667LOFw7iwWqBXTeAlv7zQX0VOOSYEzQZMR9mitnqZPwn gLgjZV1DP/jsitz/6TIlF93Oh33yfjxCrBlw2BoopfcEeZ/zNowSNGNLhuoejHIUhlzQ XuHg== X-Gm-Message-State: AOAM531vBCJ5q/i++yko014aKhRkZlKDsH2856qGEBGrQ4KAYvbpJVkE BSWWNrFhvHEUsLC7GMUA/rR6iElchxMUfrY3g3k= X-Google-Smtp-Source: ABdhPJxTpUPnjB+OKI1B33AWXKKwiwip2xtpcCUGFZXCzalPr3BZ5mmjE3aKrCrh0LNbkBwjweuHET8RHv3LgFks1mk= X-Received: by 2002:a2e:7819:: with SMTP id t25mr1732744ljc.93.1619080665330; Thu, 22 Apr 2021 01:37:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 22 Apr 2021 10:37:29 +0200 Message-ID: To: Marco Pivetta Cc: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000eb76fd05c08b9792" Subject: Re: [PHP-DEV] [RFC] [Vote] Adding return types to internal methods From: nikita.ppv@gmail.com (Nikita Popov) --000000000000eb76fd05c08b9792 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 22, 2021 at 9:56 AM Marco Pivetta wrote: > Hey M=C3=A1t=C3=A9, > > On Thu, Apr 22, 2021, 09:42 M=C3=A1t=C3=A9 Kocsis wrote: > > > Hi Internals, > > > > I've just opened the vote about > > https://wiki.php.net/rfc/internal_method_return_types > > and I will close it on 2021-05-06. > > > > For prior discussion, please see https://externals.io/message/113413 > > > Overall OK with the RFC, but we do such a.fuss about not breaking compat = on > inheritance for then breaking it in reflection, where we add two methods > that completely shake down the tree. > > Therefore I voted NO, especially considering the implications this has on > libraries like BetterReflection: the return type is there and it is clear= , > it just hasn't been explicitly declared by the engine, but there isn't a > need for dropping it from reflection. > > In fact, if reflection were to switch to the actual runtime return types = of > those methods, I don't see a reason why downstream consumers would break > (stubbing tools, code generators, type checkers, dependency solvers, etc.= ) > > I would vote yes on the RFC if this section were omitted, and reflection > started to report the new types in 8.1 (or another 8.x). > It seems pretty important to me that there is a distinction between these -- apart from one measly deprecation warning (that can be ignored), these return types effectively do not exist. You can't treat them the same way. If you have a (non-final) method with a tentative return type, then you don't have a guarantee that it actually returns a value of that type. To clarify what you're actually suggesting here: Do you want to always have the type returned from getReturnType() and only add an additional bool method that tells you whether that is a tentative or real type, so that most code can just treat them as being the same thing? Regards, Nikita --000000000000eb76fd05c08b9792--