php-src/Zend/tests/property_hooks/parent_set.phpt
Ilija Tovilo 780a8280d2
[RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00

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)