xref: /php-src/Zend/tests/assign_to_obj_001.phpt (revision 902d6439)
1--TEST--
2assign to object leaks with ref
3--FILE--
4<?php
5function &a($i) {
6    $a = "str". $i ."ing";
7    return $a;
8}
9
10class A {
11    public $a;
12    public function test() {
13        $this->a = a(1);
14        unset($this->a);
15    }
16}
17
18$a = new A;
19
20$a->test();
21$a->test();
22echo "okey";
23?>
24--EXPECT--
25okey
26