xref: /PHP-8.0/Zend/tests/bug71067.phpt (revision 9ed2f489)
1--TEST--
2Bug #71067 (Local object in class method stays in memory for each call)
3--INI--
4error_reporting=0
5--FILE--
6<?php
7class Test {
8    public function test(){
9        $arr = (object) [
10            'children' => []
11        ];
12        $arr->children[] = 1;
13        return $arr;
14    }
15}
16
17$o = new Test();
18$o->test();
19
20print_r($o->test());
21?>
22--EXPECT--
23stdClass Object
24(
25    [children] => Array
26        (
27            [0] => 1
28        )
29
30)
31