xref: /PHP-8.2/Zend/tests/bug72177_2.phpt (revision 6e16e1da)
1--TEST--
2Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
3--FILE--
4<?php
5class Foo
6{
7    private $bar = 'bar';
8
9    public function __construct()
10    {
11        unset($this->bar);
12    }
13}
14
15class Bar extends Foo
16{
17    private $baz = 'baz';
18    private static $tab = 'tab';
19
20    public function __get(string $name)
21    {
22        var_dump($this->baz);
23        var_dump(self::$tab);
24        return $name;
25    }
26}
27
28$r = new ReflectionProperty(Foo::class, 'bar');
29
30echo "OK\n";
31?>
32--EXPECT--
33OK
34