Annotation of embedaddon/php/Zend/tests/ns_064.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Magic methods in overrided stdClass inside namespace
3: --FILE--
4: <?php
5:
6: namespace test;
7:
8: class foo {
9: public $e = array();
10:
11: public function __construct() {
12: $this->e[] = $this;
13: }
14:
15: public function __set($a, $b) {
16: var_dump($a, $b);
17: }
18: public function __get($a) {
19: var_dump($a);
20: return $this;
21: }
22: }
23:
24: use test\foo as stdClass;
25:
26: $x = new stdClass;
27: $x->a = 1;
28: $x->b->c = 1;
29: $x->d->e[0]->f = 2;
30:
31: ?>
32: --EXPECT--
33: string(1) "a"
34: int(1)
35: string(1) "b"
36: string(1) "c"
37: int(1)
38: string(1) "d"
39: string(1) "f"
40: int(2)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>