mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

RFC: https://wiki.php.net/rfc/property-hooks Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
23 lines
253 B
PHP
23 lines
253 B
PHP
--TEST--
|
|
Inherited hooks change visibility with property
|
|
--FILE--
|
|
<?php
|
|
|
|
class A {
|
|
protected $prop {
|
|
get => 42;
|
|
}
|
|
}
|
|
|
|
class B extends A {
|
|
public $prop {
|
|
set {}
|
|
}
|
|
}
|
|
|
|
$b = new B();
|
|
var_dump($b->prop);
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(42)
|