mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
31 lines
404 B
PHP
31 lines
404 B
PHP
--TEST--
|
|
Bug 001
|
|
--FILE--
|
|
<?php
|
|
|
|
abstract class A {
|
|
abstract public $x { get; }
|
|
}
|
|
|
|
class C extends A {
|
|
private $_x;
|
|
public $x {
|
|
get => $this->_x;
|
|
}
|
|
}
|
|
|
|
var_dump((new ReflectionProperty(C::class, 'x'))->isVirtual());
|
|
|
|
$c = new C;
|
|
|
|
try {
|
|
$c->x = 3;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
Cannot write to get-only virtual property C::$x
|