summaryrefslogtreecommitdiff
path: root/Zend/tests/objects_019.phpt
blob: 53889edfabe1e8aa1851bed26bc605f1b596d11f (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
--TEST--
Testing references of dynamic properties
--FILE--
<?php

error_reporting(E_ALL);

$foo = array(new stdclass, new stdclass);

$foo[1]->a = &$foo[0]->a;
$foo[0]->a = 2;

$x = $foo[1]->a;
$x = 'foo';

var_dump($foo, $x);

?>
--EXPECT--
array(2) {
  [0]=>
  object(stdClass)#1 (1) {
    ["a"]=>
    &int(2)
  }
  [1]=>
  object(stdClass)#2 (1) {
    ["a"]=>
    &int(2)
  }
}
string(3) "foo"