Re: [PHP] References challenge with PHP4

2007-03-19 Thread Lluis Pamies
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

[PHP] References challenge with PHP4

2007-03-16 Thread Lluis Pamies
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()