File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug34893.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    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>