source: src/router/php7/Zend/tests/bug72177.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 530 bytes
Line 
1--TEST--
2Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
3--FILE--
4<?php
5class Child
6{
7    protected $bar;
8
9    public function __destruct()
10    {
11        $this->bar = null;
12    }
13}
14
15class Parnt
16{
17    protected $child;
18
19    public function doSomething()
20    {
21        $this->child = new Child();
22
23        $prop = new \ReflectionProperty($this, 'child');
24        $prop->setAccessible(true);
25        $prop->setValue($this, null);
26    }
27}
28
29$p = new Parnt();
30$p->doSomething();
31
32echo "OK\n";
33?>
34--EXPECT--
35OK
Note: See TracBrowser for help on using the repository browser.