1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Simplify a-vis error message

This commit is contained in:
Ilija Tovilo
2024-09-03 12:18:07 +02:00
parent 407bc092db
commit 7f0d2574f0
3 changed files with 6 additions and 3 deletions

View File

@@ -11,4 +11,4 @@ class Foo {
?>
--EXPECTF--
Fatal error: Unilateral virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d
Fatal error: Read-only virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d

View File

@@ -11,4 +11,4 @@ class Foo {
?>
--EXPECTF--
Fatal error: Unilateral virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d
Fatal error: Write-only virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d

View File

@@ -1709,8 +1709,11 @@ ZEND_API void zend_verify_hooked_property(zend_class_entry *ce, zend_property_in
if ((prop_info->flags & ZEND_ACC_VIRTUAL)
&& (prop_info->flags & ZEND_ACC_PPP_SET_MASK)
&& (!prop_info->hooks[ZEND_PROPERTY_HOOK_GET] || !prop_info->hooks[ZEND_PROPERTY_HOOK_SET])) {
const char *prefix = !prop_info->hooks[ZEND_PROPERTY_HOOK_GET]
? "Write-only" : "Read-only";
zend_error_noreturn(E_COMPILE_ERROR,
"Unilateral virtual property %s::$%s must not specify asymmetric visibility", ZSTR_VAL(ce->name), ZSTR_VAL(prop_name));
"%s virtual property %s::$%s must not specify asymmetric visibility",
prefix, ZSTR_VAL(ce->name), ZSTR_VAL(prop_name));
}
}