En/na Jochem Maas ha escrit:
Lluis Pamies wrote:
I've the following code:
1 a = &$a;
6 }
7
8 function run() {
9 print "{$this->a->msg}\n";
10 }
11 }
12
13 class A {
14 function A() {
15 $this->b = new B(&$this);
16 }
17
18
I've the following code:
1 a = &$a;
6 }
7
8 function run() {
9 print "{$this->a->msg}\n";
10 }
11 }
12
13 class A {
14 function A() {
15 $this->b = new B(&$this);
16 }
17
18 function &getInstance() {
19 static $inst;
20 if(!isset($inst)) $inst = new A()
2 matches
Mail list logo