Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116152 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48808 invoked from network); 24 Sep 2021 13:30:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Sep 2021 13:30:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6ABC11804BA for ; Fri, 24 Sep 2021 07:11:58 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.0.0/20 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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, 24 Sep 2021 07:11:57 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4A6EB5C01D4 for ; Fri, 24 Sep 2021 10:11:57 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Fri, 24 Sep 2021 10:11:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=En2sOW L91FPo4SAhnzAUbVEeqICC0WlA1tQo04rdrsM=; b=PV1pMmtfMkKmjcKHIxt9s3 DtLaWhXj1H9wgOuUSSS5tvpy1i826JrNCiiRrwLoNIeKVR/lDB8efTe9TINUHPD0 KoE4JqDqZuNf6qGd+D7uI+dEf9tg/xthlGIy+VB4yg3VrrhPDOgfpPY+7C5mKxHZ VFIW/H+DJSMM2KlvVOtGKwtSFw8BssQ2S7C8obR6MGUzF6RS52ChVaeycDiv6/4F rjtcoxmVobcMSn7+6m1+NVxyB9dPwPzoWViWPL8T0rUevyWtU+e8Tcq8m1CBu6cG OAf2/vADAmMycu4iZYMctJ1qf1TilZmF9wC7c2IE+21YBwr7Fi978XBPnQnFJ/Rg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejuddgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 12BBBAC03AF; Fri, 24 Sep 2021 10:11:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1303-gb2406efd75-fm-20210922.002-gb2406efd Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Fri, 24 Sep 2021 09:11:36 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] BC breaking changes in PHP 8.1 From: larry@garfieldtech.com ("Larry Garfield") On Thu, Sep 23, 2021, at 11:52 AM, Nikita Popov wrote: > I believe the changes in PHP 8.1 with the highest migration burden for > open-source libraries are the additional of tentative return types (aka > "put #[ReturnTypeWillChange] everywhere") and deprecation of null arguments > to internal functions, followed by the float to int precision-loss > deprecation and, depending on project, the Serializable deprecation. > > What all of these have in common, is that they are all semver compliant > changes, because they "only" introduce deprecations. Deprecations are > explicitly not considered backwards-compatibility breaks. > > Now, there are two problems with this picture: The first one is that > deprecations often get promoted to exceptions by generic error handlers. I > believe that this continues to be the default behavior of PHPUnit for > example. This means that in practice, deprecations do break code, even > though they are intended not to. > > The second one is that this does not really hold up for open-source > libraries. At the application layer, you can suppress all deprecations, and > call it a day. At the library layer, the usual perception is that if your > library throws deprecation warnings, it's not compatible with the given > version of PHP. Taken in conjunction with deprecation to exception > promotion (in test suites if nothing else) there is some truth to that > perception. > > While deprecations are intended as a backwards-compatible mechanism to warn > you about upcoming changes without requiring immediate action, in reality > open-source libraries have to treat deprecations as immediate breakage. Might one possible way forward be to work with the PHPUnit folks to make deprecations not a test-breaking issue, but report them side-channel somehow? (Like "risky" tests now pass, but have an extra note on them.) That seems like it would resolve the "deprecations get turned into breaking changes immediately" problem, at least. --Larry Garfield