1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/reflection/tests/property_hooks/ReflectionProperty_getSetValue.phpt
2024-07-14 11:55:03 +02:00

29 lines
520 B
PHP

--TEST--
ReflectionProperty::{get,set}Value() invokes hooks
--FILE--
<?php
class Test {
public $a {
get {
echo "Get called\n";
return 'Foo';
}
set {
echo "Set called with value $value\n";
}
}
}
$propertyReflection = (new ReflectionProperty(Test::class, 'a'));
$test = new Test();
var_dump($propertyReflection->getValue($test));
$propertyReflection->setValue($test, 'Baz');
?>
--EXPECT--
Get called
string(3) "Foo"
Set called with value Baz