mirror of
https://github.com/php/php-src.git
synced 2024-12-21 16:00:18 +08:00
35 lines
538 B
PHP
35 lines
538 B
PHP
--TEST--
|
|
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
|
|
--FILE--
|
|
<?php
|
|
class Foo
|
|
{
|
|
private $bar = 'bar';
|
|
|
|
public function __construct()
|
|
{
|
|
unset($this->bar);
|
|
}
|
|
}
|
|
|
|
class Bar extends Foo
|
|
{
|
|
private $baz = 'baz';
|
|
private static $tab = 'tab';
|
|
|
|
public function __get(string $name)
|
|
{
|
|
var_dump($this->baz);
|
|
var_dump(self::$tab);
|
|
return $name;
|
|
}
|
|
}
|
|
|
|
$r = new ReflectionProperty(Foo::class, 'bar');
|
|
|
|
$r->setAccessible(true);
|
|
echo "OK\n";
|
|
?>
|
|
--EXPECT--
|
|
OK
|