summaryrefslogtreecommitdiff
path: root/tests/lang/bug35239.phpt
blob: 22ed25b1d623f36554652429afa3a76cf5219412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
Bug #35239 (Objects can lose references)
--FILE--
<?php
$a = new stdClass; 
$a->x0 = new stdClass;
$a->x0->y0 = 'a';
$a->x0->y1 =& $a->x0;
$a->x0->y2 =& $a->x0;
$a->x0->y0 = 'b';
var_dump($a);
$a->x0->y1 = "ok\n";
var_dump($a->x0);
?>
--EXPECT--
object(stdClass)(1) {
  ["x0"]=>
  &object(stdClass)(3) {
    ["y0"]=>
    string(1) "b"
    ["y1"]=>
    &object(stdClass)(3) {
      ["y0"]=>
      string(1) "b"
      ["y1"]=>
      *RECURSION*
      ["y2"]=>
      *RECURSION*
    }
    ["y2"]=>
    &object(stdClass)(3) {
      ["y0"]=>
      string(1) "b"
      ["y1"]=>
      *RECURSION*
      ["y2"]=>
      *RECURSION*
    }
  }
}
string(2) "ok"