1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/property_hooks/interface_get_only_readonly.phpt
2024-07-14 11:55:03 +02:00

16 lines
271 B
PHP

--TEST--
readonly property satisfies get only interface property
--FILE--
<?php
interface I {
public int $prop { get; }
}
class C implements I {
public function __construct(public readonly int $prop) {}
}
$c = new C(42);
var_dump($c->prop);
?>
--EXPECT--
int(42)