Annotation of embedaddon/php/Zend/tests/bug34893.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #34893 (PHP5.1 overloading, Cannot access private property)
! 3: --FILE--
! 4: <?php
! 5: class A {
! 6: private $p;
! 7: function __get($name){
! 8: return $this->$name;
! 9: }
! 10: function __set($name, $value) {
! 11: $this->$name = $value;
! 12: }
! 13: }
! 14: class B {
! 15: private $t;
! 16: function __get($name){
! 17: return $this->$name;
! 18: }
! 19: function __set($name, $value) {
! 20: $this->$name = $value;
! 21: }
! 22: }
! 23: $a = new A;
! 24: $b = new B;
! 25: $a->p = $b;
! 26: $b->t = "foo";
! 27:
! 28: echo $a->p->t;
! 29: $a->p->t = "bar";
! 30: echo $a->p->t;
! 31: ?>
! 32: --EXPECT--
! 33: foobar
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>