Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114727 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68213 invoked from network); 4 Jun 2021 08:53:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jun 2021 08:53:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E1AF01804D8 for ; Fri, 4 Jun 2021 02:07:28 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 ; Fri, 4 Jun 2021 02:07:28 -0700 (PDT) Received: by mail-pj1-f49.google.com with SMTP id g24so5193784pji.4 for ; Fri, 04 Jun 2021 02:07:28 -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=jpSHmLMe5wzlYsQpX3fWXLw4es7Qeowgd/Ko1VQV4Uc=; b=d0SuONwM/OA1mr2D17xmrKRJyHJTU/zCDjB1iH0F+FPul05dYCa9cA6S/a5DJmcBvC X9UCx/0CT9DIwm3sWPl5aKpvJ748fPViwOiGAwbdOr+BSisXse9DqtUzwHN73Z00wP6e Rm5tIZPx497uz+GlMnsdQaQp6qezkw72nO1OOKcsuGpzxDfPzJ30YIllGNAmdmai3yDe 5+3IAC+teMsyXuSlqH6flHRNBC1JvAClo5Px7fiRZscXCVF4JrAAfxbYil736OOktwyn DlyFm2he9T6bU53w1E/5xjA7KEK0TTJxC4NZCxTMtWUuF9tIodhWJQwSyP9I5nTDJ3MF zdQQ== 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=jpSHmLMe5wzlYsQpX3fWXLw4es7Qeowgd/Ko1VQV4Uc=; b=jUl8g1lpn8G48YyJGc0SYnSeiXCOSIwXcgHYOljuzAzjTaGSS4WOyNrA31RyoriMW5 WCYBQNafEmBkQJMsPXGSxqjMu9IjEs/O+o8TCuxTm+pBhDM2napK8N7MvxEgkPG0FAg4 ZQGWIyY69ggFQpcjPpD4sRWJWWZfTJtuiM5X3miDBxrSRVss69jRe5kXCiDDvRhtqhh0 dqMAk9WRG4uPqlA2yu7lchY3tQrsu/DISpMAfHfcIe+5ui487oYGQq2xhkeAHJwsXpd5 KaycThE2WZJV149TSVqlE2DWm3Ya1SU/XccoFOw4MZQu1FmQBg0hB+VYTnWWHCHXclqO 4klw== X-Gm-Message-State: AOAM532rqz9Ccd8p+E0J7N6q2KonIKGC7y5G1aBbzlyoxomWp27ptOOl FFB8/wkup9qfUf7JXuYsIQj1tye6frgxIV12s70= X-Google-Smtp-Source: ABdhPJyTdMS9uGbB5oN0OPMvsEbdvMuF8bmTEGpUFXZ//68kaiytgfVhJTMBnKrSgNjml4KTgAb8WOsStCWP/4UMGBk= X-Received: by 2002:a17:902:d643:b029:ef:62cd:eeed with SMTP id y3-20020a170902d643b02900ef62cdeeedmr3377330plh.42.1622797647048; Fri, 04 Jun 2021 02:07:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 4 Jun 2021 11:07:15 +0200 Message-ID: To: Nikita Popov Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000004b73d605c3ed051d" Subject: Re: [PHP-DEV] [RFC] [Vote] Adding return types to internal methods From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --0000000000004b73d605c3ed051d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > This feels a bit different than the class case, in that implementing > internal interfaces is common, while extending internal classes is mostly > an artifact of us not adding enough "final"s in the early days. > I have to admit that this aspect of the feature wasn't accurately covered by RFC, sorry for that. And I agree that interface changes will imply a bit more effort to migrate; however, I believe this is for the good. For example, until a few weeks ago, probably only very few people knew what a custom SessionHandlerInterface::read() implementation should really return in case of an error: neither our stubs, nor the manual had it correctly. I "accidentally" learned about the issue (that false should be returned in case of an error) because a test failed when I was implementing this RFC. Afterwards, I fixed the return type in the stubs as well as in the documentation: https://github.com/php/php-src/pull/6884/files#diff-c6492b1d4bee1c7c3eca01e= 4b30af39a438ba823efa220fe1d0e5868bd58586eR74 With all that said, I am ok to have some exceptions if it turns out that a return type declaration is too disruptive for the ecosystem, but I'm hopeful that the new return types - even for interfaces - will be beneficia= l overall. Regards, M=C3=A1t=C3=A9 --0000000000004b73d605c3ed051d--