From df92c205491c5248268b4ac8bfd5d1f780903b89 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. Closes GH-12069 --- 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 e0b7c66ed717..c3e172404f0c 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 0ed43239d2eb..f986aac71ca2 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 ec4ca50633aa..9edd451383ef 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(); }