php-src/Zend/tests/property_hooks/interface_get_set_readonly.phpt
Ilija Tovilo 8df557ac42
[RFC] Asymmetric visibility v2 (GH-15063)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2024-08-27 02:04:48 +02:00

15 lines
426 B
PHP

--TEST--
readonly property does not satisfy get/set interface property
--DESCRIPTION--
The error message should be improved, the set access level comes from readonly.
--FILE--
<?php
interface I {
public int $prop { get; set; }
}
class C implements I {
public function __construct(public readonly int $prop) {}
}
?>
--EXPECTF--
Fatal error: Set access level of C::$prop must be omitted (as in class I) in %s on line %d