diff options
Diffstat (limited to 'ext/reflection/tests')
| -rw-r--r-- | ext/reflection/tests/bug75231.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug75231.phpt b/ext/reflection/tests/bug75231.phpt new file mode 100644 index 0000000000..5aff0be19c --- /dev/null +++ b/ext/reflection/tests/bug75231.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #75231: ReflectionProperty#getValue() incorrectly works with inherited classes +--FILE-- +<?php +class A +{ + public $prop; + public function __construct() + { + $this->prop = 'prop'; + } + public function method() + { + return 'method'; + } +} +class B extends A +{ +} +print_r((new ReflectionMethod(B::class, 'method'))->invoke(new A()).PHP_EOL); +print_r((new ReflectionProperty(B::class, 'prop'))->getValue(new A()).PHP_EOL); +?> +--EXPECT-- +method +prop |
