Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115683 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14563 invoked from network); 10 Aug 2021 09:24:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Aug 2021 09:24:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D420F180212 for ; Tue, 10 Aug 2021 02:55:15 -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_50,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY 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-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 ; Tue, 10 Aug 2021 02:55:15 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id b6so23955230lff.10 for ; Tue, 10 Aug 2021 02:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sensational.ch; s=google; h=mime-version:from:date:message-id:subject:to; bh=JcsYzI5guz5+SVx+VtS+PVY0dKltDXoEfJD9ECQYiI4=; b=TOqv4vjMKq87xaYK807m8If4bZk9J6U5LoZHyn7UIuiRdnfM9ydO2qYtVRpbrO84VA 6LvuP93BKIhmiDs1nTBq8DZKGIuajl7FKKvkcvANQ50MFOZmQwSlJktC6uyfaiAjIHZ1 6+FTJ3I0/FOb7+BrzbBTTqX3J9C3uG5sxqBZG+9DumHJiM2RfvIF4zQY0igmcof2rW8B /rx5QD2wI+nCbWRDH/fPE280AmjUjAw34PX5v1nhX5Vp3tSdGvyp3MirM+Y9cCrPxt3U glUxfinC1pKn9YGC3UMbOQ0X7jrI6i/PECGtlccEN3AR+QvKlPnajUFoNd7PlNLtYOl1 0FFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=JcsYzI5guz5+SVx+VtS+PVY0dKltDXoEfJD9ECQYiI4=; b=XMySgS52qL7W+vLY4w4/1WRmSNxE+Tv2lD05DGquhARJjqDZOjG2IYuPKSLoQUXqr0 9rGHvd9gukCGxUgwYQlsGVia885Gb1SVGu4DCVakQq3TJ9Ky2ZV/fu4lhJXa8nJcUd4V Z+TX+pJhuP+2gEfUlB7b2Fq34Viqyy6CmvCXE8AYVrevxW+NnSIRzcpUlz2QcTDsLDEi Jke3O/1/ugcoT7mjXTYohH9zRL4G84qdxeJkQAoSHx3ySB/837jqatEhlqSlMgyV/l0l fK8BGpa4Jawjkt9e3WQosfAj19khUNg0eKtBsibdFfMMzP35HbWrDUIj+e8SbWquZi7k eq2A== X-Gm-Message-State: AOAM531NrJnnVe8xeKv3u7KU05V+owq/Akvj0sKEwquvJLqA++KSds4t M0MrAFbIWtTexs0Wy2alsuUcVvSBj7BFcjU1FhlL6pu+qR/8HQ== X-Google-Smtp-Source: ABdhPJxYwcborMdxg11COtd/JxpYHwntOx4RSHBagM1QB6JZyALuCKLbCG2SSEJYR25mMeCmA0KJ/WgECmWupY05HAg= X-Received: by 2002:ac2:4a7a:: with SMTP id q26mr20950914lfp.582.1628589313152; Tue, 10 Aug 2021 02:55:13 -0700 (PDT) Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Tue, 10 Aug 2021 09:55:12 +0000 Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Tue, 10 Aug 2021 09:55:07 +0000 Mime-Version: 1.0 (Mimestream 0.26.2) Date: Tue, 10 Aug 2021 09:55:12 +0000 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000007eedb205c9317f89" Subject: 8.1 / Exception / Property Type / Backwards compatbility From: phofstetter@sensational.ch (Philip Hofstetter) --0000000000007eedb205c9317f89 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello The following valid <=3D PHP 8.0 code that intends to make the $line proper= ty public is a fatal error in 8.1 class FooException extends Exception { public $line; } However, the fixed code for 8.1: class FooException extends Exception { public int $line; } Is a fatal error in <=3D 8.0 Is there a way to create a class that makes the $line property public that=E2=80=99s compatible with all versions of PHP without requiring condit= ional declaration of the class? For method return types, we have #[ReturnTypeWillChange], but for property types =F0=9F=A4=B7=E2=80=8D=E2=99=80=EF=B8=8F Philip --0000000000007eedb205c9317f89--