From 60f614e381865b7c33701daabd0c58696b9fe392 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Thu, 28 Nov 2024 15:39:43 +0100 Subject: [PATCH 1/2] [PHP 8.3] Check variance of class constants --- language/oop5/constants.xml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/language/oop5/constants.xml b/language/oop5/constants.xml index 8caffc7a07f2..1b3837399fb7 100644 --- a/language/oop5/constants.xml +++ b/language/oop5/constants.xml @@ -120,10 +120,42 @@ Fatal error: Uncaught Error: Cannot access private const Foo::BAZ in … As of PHP 7.1.0 visibility modifiers are allowed for class constants. + + Class constant visibility variance check, as of PHP 8.3.0 + + +]]> + + &example.outputs.83; + + + + + + + As of PHP 8.3.0 visibility variance is checked more strictly. Prior to this + version, the visibility of a class constant could be different from the + visibility of the constant in the implemented interface. + + Fetch class constant syntax, as of PHP 8.3.0 - Date: Thu, 28 Nov 2024 16:17:12 +0000 Subject: [PATCH 2/2] Update language/oop5/constants.xml --- language/oop5/constants.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/language/oop5/constants.xml b/language/oop5/constants.xml index 1b3837399fb7..803a8780ce9a 100644 --- a/language/oop5/constants.xml +++ b/language/oop5/constants.xml @@ -147,9 +147,9 @@ Fatal error: Access level to MyClass::VALUE must be public (as in interface MyIn - As of PHP 8.3.0 visibility variance is checked more strictly. Prior to this - version, the visibility of a class constant could be different from the - visibility of the constant in the implemented interface. + As of PHP 8.3.0 visibility variance is checked more strictly. + Prior to this version, the visibility of a class constant could be different + from the visibility of the constant in the implemented interface.