From 011071a3b3f0f60c3d8ff70479251ed8873f90ec Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 11 Sep 2023 13:57:37 +0200 Subject: [PATCH] Improve invalid cpp modifier message The ZEND_MODIFIER_TARGET_CPP should really have been called _PARAM, but we shouldn't break API at this point. Fixes GH-12069 Closes GH-12175 --- Zend/tests/ctor_promotion_additional_modifiers.phpt | 2 +- Zend/tests/type_declarations/static_type_param.phpt | 2 +- Zend/zend_compile.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/tests/ctor_promotion_additional_modifiers.phpt b/Zend/tests/ctor_promotion_additional_modifiers.phpt index e0b7c66ed71..c3e172404f0 100644 --- a/Zend/tests/ctor_promotion_additional_modifiers.phpt +++ b/Zend/tests/ctor_promotion_additional_modifiers.phpt @@ -9,4 +9,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot use the static modifier on a promoted property in %s on line %d +Fatal error: Cannot use the static modifier on a parameter in %s on line %d diff --git a/Zend/tests/type_declarations/static_type_param.phpt b/Zend/tests/type_declarations/static_type_param.phpt index 0ed43239d2e..f986aac71ca 100644 --- a/Zend/tests/type_declarations/static_type_param.phpt +++ b/Zend/tests/type_declarations/static_type_param.phpt @@ -12,4 +12,4 @@ class Test { ?> --EXPECTF-- -Fatal error: Cannot use the static modifier on a promoted property in %s on line %d +Fatal error: Cannot use the static modifier on a parameter in %s on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ec4ca50633a..9edd451383e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -869,7 +869,7 @@ uint32_t zend_modifier_token_to_flag(zend_modifier_target target, uint32_t token } else if (target == ZEND_MODIFIER_TARGET_CONSTANT) { member = "class constant"; } else if (target == ZEND_MODIFIER_TARGET_CPP) { - member = "promoted property"; + member = "parameter"; } else { ZEND_UNREACHABLE(); }