Annotation of embedaddon/php/tests/lang/this_assignment.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test to catch early assignment of $this
3: --FILE--
4: <?php
5: class first {
6:
7: function me() { echo "first"; }
8:
9: function who() {
10: global $a,$b;
11: $this->me();
12: $a->me();
13: $b->me();
14: $b = new second();
15: $this->me();
16: $a->me();
17: $b->me();
18: }
19: }
20:
21: class second {
22:
23: function who() {
24: global $a,$b;
25: $this->me();
26: $a->me();
27: $b->me();
28: }
29: function me() { echo "second"; }
30: }
31:
32: $a = new first();
33: $b = &$a;
34:
35: $a->who();
36: $b->who();
37:
38: echo "\n";
39: ?>
40: ===DONE===
41: --EXPECT--
42: firstfirstfirstfirstsecondsecondsecondsecondsecond
43: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>