mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
RFC: https://wiki.php.net/rfc/property-hooks Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
26 lines
325 B
PHP
26 lines
325 B
PHP
--TEST--
|
|
Abstract properties correctly track virtualness
|
|
--FILE--
|
|
<?php
|
|
|
|
abstract class Y {
|
|
abstract public string $prop {
|
|
get;
|
|
set => "foo";
|
|
}
|
|
}
|
|
|
|
class X extends Y {
|
|
public string $prop {
|
|
get => "bar";
|
|
}
|
|
}
|
|
|
|
$x = new X;
|
|
$x->prop = 1;
|
|
var_dump($x->prop);
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(3) "bar"
|