Annotation of embedaddon/php/Zend/tests/objects_024.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Testing direct assigning for property of object returned by function
3: --FILE--
4: <?php
5:
6: class foo {
7: static $bar = array();
8:
9: public function __set($a, $b) {
10: self::$bar[] = $b;
11: }
12:
13: public function __get($a) {
14: /* last */
15: return self::$bar[count(self::$bar)-1];
16: }
17: }
18:
19: function test() {
20: return new foo;
21: }
22:
23: $a = test()->bar = 1;
24: var_dump($a, count(foo::$bar), test()->whatever);
25:
26: print "\n";
27:
28: $a = test()->bar = NULL;
29: var_dump($a, count(foo::$bar), test()->whatever);
30:
31: print "\n";
32:
33: $a = test()->bar = test();
34: var_dump($a, count(foo::$bar), test()->whatever);
35:
36: print "\n";
37:
38: ?>
39: --EXPECTF--
40: int(1)
41: int(1)
42: int(1)
43:
44: NULL
45: int(2)
46: NULL
47:
48: object(foo)#%d (0) {
49: }
50: int(3)
51: object(foo)#%d (0) {
52: }
53:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>