mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
780a8280d2
RFC: https://wiki.php.net/rfc/property-hooks Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
32 lines
370 B
PHP
32 lines
370 B
PHP
--TEST--
|
|
Allow calling parent set in property hooks
|
|
--FILE--
|
|
<?php
|
|
|
|
class A {
|
|
public int $prop {
|
|
set {
|
|
var_dump($value);
|
|
}
|
|
}
|
|
}
|
|
|
|
class B extends A {
|
|
public int $prop {
|
|
set {
|
|
parent::$prop::set($value + 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
$a = new A;
|
|
$a->prop = 41;
|
|
|
|
$b = new B;
|
|
$b->prop = 41;
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(41)
|
|
int(42)
|