xref: /PHP-7.1/Zend/tests/bug72177_2.phpt (revision e9c3f9fc)
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
30$r->setAccessible(true);
31echo "OK\n";
32?>
33--EXPECT--
34OK
35