Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114135 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27618 invoked from network); 24 Apr 2021 19:05:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2021 19:05:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BD6211804C6 for ; Sat, 24 Apr 2021 12:08:45 -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-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.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 ; Sat, 24 Apr 2021 12:08:45 -0700 (PDT) Received: by mail-il1-f175.google.com with SMTP id e14so19668320ils.12 for ; Sat, 24 Apr 2021 12:08:45 -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=hFDHkbkTc5y9xTVp8yGGQ9PhJRLQwcwv2mzpjpvoTVM=; b=G1eMgEkxsdfpht/Q5LG1VDPu2jEybEtIdUKD9IdBzHQNsDJGerUhxoZRsUJvgeKZkY Md2t5vC/rl9VimgeCxsfGIXYUIFa8ndzS/21j9O6MV1w1UJVxfVxvz/O+6plT+mZWh8O 8SYywssSPJG1HSkHSWGEA5BRBYi8dstVjPJfgSNRGsFCGrhXmkq2/tile4VyoFMNB4CG qj6E45OLRjCBGPBiS/Tec9DI4pcUaJKbQrijNF0P90D0+FSxbxGwMpseChyvSzKTxg9T RlmvUu/hv8cLKpBMoglnPJZuUGqcYQZClR01p4UlV8mQnhEumJ6dVWN4HJjBCSt+mZN8 ERZw== 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=hFDHkbkTc5y9xTVp8yGGQ9PhJRLQwcwv2mzpjpvoTVM=; b=MIJmPD2JqMMpWP3qQVm1c1BbcDtBzZx6onu/jz4gEMJtSKg54+KKqgyOGkvAkeyCuS 3vwHMuGA6RBhqp0U85dV9Po3FMwY63FLrky0+dAOwiihdYolSgtD0qrz3VZPJN8NGrGm 9383E27KPcYaCwDleSjay8pWbCrbaevx/F18v+7MxcvzezjehT7srGou6Vam2xBLa4OJ HwF8W6eGGoMbd7kz0raPWT+PVcio26Ck2YVbW3YjWkXPnfjzzA20c6fCUfjeRhsJw/TS cML/aHf1zsCwYRrPkJ3VC4AvChoD2T1GD9upqHqZigKfyPo6Syq0tp/AM8af/2orKxzQ 6I8g== X-Gm-Message-State: AOAM531lNZqxSnxRypff7d8fWz0iqG6vXn+1gq3r/V/j695CoC+hdoiU 1+5c13nBCiX8q1Wk65jeUu3sUfgahRyDpY6D9/4= X-Google-Smtp-Source: ABdhPJzUA2gfWHLF8ELKZiw0qAo649FrylTuy6LUTdxwQ62MHoqgrZkXLKexL++E9sm/pO2cSsqA2qzOyodxDeE6YTc= X-Received: by 2002:a92:ce0e:: with SMTP id b14mr7285887ilo.283.1619291322996; Sat, 24 Apr 2021 12:08:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 24 Apr 2021 21:08:30 +0200 Message-ID: To: tyson andre Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000185c1605c0bca46f" Subject: Re: [PHP-DEV] [RFC] [Vote] Adding return types to internal methods From: ocramius@gmail.com (Marco Pivetta) --000000000000185c1605c0bca46f Content-Type: text/plain; charset="UTF-8" Hey Tyson, On Sat, Apr 24, 2021, 19:24 tyson andre wrote: > Hi Marco Pivetta, > > > 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.) > > If the published library/application had to support older versions (e.g. > php 7.4), > but the tentative return types contained types/syntaxes that required php > 8.0 > (e.g. union types such as `string|false`, new types such as > `mixed`/`never`, etc,) > then the code generators and type checkers and stubbing tools would need > to be > updated to exclude the new tentative return types much earlier than > absolutely needed. > From experience, code generated with tooling while running on newer PHP versions is already incompatible with older PHP versions: you re-generate the code when changing any of the dependencies anyway (think "no ABI compatibility"). This is at least true for all codegen tools I worked/contributed to/used on so far. We're mostly breaking BC (new methods on reflection symbols, requiring special treatment) for stuff that is really an edge case that is only affecting tooling that would really work just fine even if the reflection API started to report the real return types now (no API change whatsoever). What's the plan for PHP 9 about these methods? Deprecation/removal? Or are we adding something that we'll have to drag on forever? --000000000000185c1605c0bca46f--