Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115859 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22220 invoked from network); 26 Aug 2021 14:08:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Aug 2021 14:08:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 60B331804DB for ; Thu, 26 Aug 2021 07:43:23 -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=-0.4 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE 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-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) (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, 26 Aug 2021 07:43:22 -0700 (PDT) Received: by mail-ua1-f51.google.com with SMTP id x6so1703451uai.11 for ; Thu, 26 Aug 2021 07:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6a+y244vRjtovU4DxVYFRsOAGcYa49lYazYk9KvOBsI=; b=0eTfeF2qDRSKxxKQgLlU29TQ84IwVBSUtN63bskOk1s9OCvcuuhJk7Md2obLeS1QHc Z4wWcqpjgg2hOoqgi7u/cxw2az1k2maZ4oYcj1ROz3cFvx+PjjHrjHmpf+FM+owWNXOM dbw16vG7LUOhmYqh8GfmNqJSAx+GtHQvZ89VsPznSr6wVxMtZVy9NOeEvVHZ48IHjctI 2aJyTOGrmOq6ywOydLLLJwcR+pX807rkItP1VLSU+0V7VUwaR7pqzbobHeKob1HJb2ub 3Yminho+vxmyJZglgrbVaLVnRriQvtZmDLToHVwdm9YOyI5EIIHqkt48uaAw+R3PVrkM scNg== 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:content-transfer-encoding; bh=6a+y244vRjtovU4DxVYFRsOAGcYa49lYazYk9KvOBsI=; b=C220YnF/vzG9alNa+Ci/3syo6D0VIJaxcW8T9FjDgA8IQ2lBfemJBYUGCrw5XY1yBF sUnVWspncF0+jN2hsRchNZ38dvYsm8VkMCerq5sjOWkg6Fs3NBNchzTRSHC/nKf1zApJ nABtnhvG7jFOiIU+zljg9sdEOy4qfJQzdk3B/MVpfXIIDGh19iiGODQc2KMgnaTcJK/a lcm9kV/xl6DCa9DFqy19CTUo3XMitDDQhbRmn9mSuq62IGH/aeZolamUqRhf23O9OKJh xy5QC8OlZISleeB68tBB3I7rWaNhrZ3BNg0cSzmdbI18440JhQFeXVkD8EJWMP4Cdmj9 XvLQ== X-Gm-Message-State: AOAM531pZDoXhFma7FEvJct4b2G9QkbzNFfNCFVBsp0GlOKBXRf7sQon 6ZO+f1oJuxQYUdUWTRXSU27K+nYGh9j0pe9yTNWc0Q== X-Google-Smtp-Source: ABdhPJwDialXv0mugIvaNauHgrDbUy0r7emxesInRZX4RV3zGl0F3z2NACF1RGmHmNcqvPSeetXUTbXfSZrYJnE36yU= X-Received: by 2002:ab0:4305:: with SMTP id k5mr2544876uak.52.1629988996810; Thu, 26 Aug 2021 07:43:16 -0700 (PDT) MIME-Version: 1.0 References: <775dc98a-b3c5-d498-71f7-9f19ff891f29@telia.com> In-Reply-To: <775dc98a-b3c5-d498-71f7-9f19ff891f29@telia.com> Date: Thu, 26 Aug 2021 15:43:05 +0100 Message-ID: To: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Cc: Philip Hofstetter , php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility From: Danack@basereality.com (Dan Ackroyd) On Thu, 26 Aug 2021 at 12:42, Bj=C3=B6rn Larsson via internals wrote: > > Den 2021-08-10 kl. 11:55, skrev Philip Hofstetter: > > The following valid <=3D PHP 8.0 code that intends to make the $line pr= operty > > public is a fatal error in 8.1 .... > > > > For method return types, we have #[ReturnTypeWillChange], but for prope= rty > > types =F0=9F=A4=B7=E2=80=8D=E2=99=80=EF=B8=8F > Hi, > > Has this been adressed / solved in some way and does it needs > to be fixed? My understanding is that the two scenarios are not the same and that there isn't much enthusiasm for 'fixing' it. For return types, the #[ReturnTypeWillChange] annotation is a temporary work-around, and one that would be used by a lot of people. It would only be used by a library until that library drops support for older versions of PHP. For the exception case, the way that (for legacy reasons) PHP supports having a public property in a child class that "overwrites" (mostly) the protected property in the parent class, is a pretty hinkey thing to do, and so this is likely to only affect a small number of people. It's not obvious to me how long a bridging annotation would need to hang around for, and it's really not obvious what the exact details of how it would work would be. I'd suggest using a getter method, which would work on all relevant version= s. cheers Dan Ack