summaryrefslogtreecommitdiff
path: root/Zend/tests/bug34893.phpt
blob: bbe02358e9e11a6d651760209538194fad4487e3 (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
--TEST--
Bug #34893 (PHP5.1 overloading, Cannot access private property)
--FILE--
<?php
class A {
	private $p;
	function __get($name){
		return $this->$name;
	}
	function __set($name, $value) {
		$this->$name = $value;
	}
}
class B {
	private $t;
	function __get($name){
		return $this->$name;
	}
	function __set($name, $value) {
		$this->$name = $value;
	}
}
$a = new A;
$b = new B;
$a->p = $b;
$b->t = "foo";

echo $a->p->t;
$a->p->t = "bar";
echo $a->p->t;
?>
--EXPECT--
foobar