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