mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
36 lines
530 B
Plaintext
36 lines
530 B
Plaintext
|
--TEST--
|
||
|
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
|
||
|
--FILE--
|
||
|
<?php
|
||
|
class Child
|
||
|
{
|
||
|
protected $bar;
|
||
|
|
||
|
public function __destruct()
|
||
|
{
|
||
|
$this->bar = null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class Parnt
|
||
|
{
|
||
|
protected $child;
|
||
|
|
||
|
public function doSomething()
|
||
|
{
|
||
|
$this->child = new Child();
|
||
|
|
||
|
$prop = new \ReflectionProperty($this, 'child');
|
||
|
$prop->setAccessible(true);
|
||
|
$prop->setValue($this, null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$p = new Parnt();
|
||
|
$p->doSomething();
|
||
|
|
||
|
echo "OK\n";
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
OK
|