Annotation of embedaddon/php/Zend/tests/bug29674.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #29674 (inherited method doesn't have access to private variables of the derived class)
3: --FILE--
4: <?php
5:
6: class BaseClass
7: {
8: private $private_base = "Base";
9:
10: function printVars ()
11: {
12: var_dump($this->private_base);
13: var_dump($this->private_child);
14: }
15: }
16:
17: class ChildClass extends BaseClass
18: {
19: private $private_child = "Child";
20: }
21:
22: echo "===BASE===\n";
23: $obj = new BaseClass;
24: $obj->printVars();
25:
26: echo "===CHILD===\n";
27: $obj = new ChildClass;
28: $obj->printVars();
29:
30: ?>
31: ===DONE===
32: --EXPECTF--
33: ===BASE===
34: string(4) "Base"
35:
36: Notice: Undefined property: BaseClass::$private_child in %sbug29674.php on line %d
37: NULL
38: ===CHILD===
39: string(4) "Base"
40:
41: Fatal error: Cannot access private property ChildClass::$private_child in %sbug29674.php on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>