[PHP] Making a object from one class available to all objects in the calling class

2001-02-05 Thread Stephen Maher
Hi, Can someone advise on the following. class class_y { function test() { return "test"; } } class class_x { function x { $n = new $y; } function z { $n->test(); } } I need the object of class_y available to t

Re: [PHP] Making a object from one class available to all objects in the calling class

2001-02-05 Thread Christian Reiniger
On Monday 05 February 2001 15:52, Stephen Maher wrote: > Hi, > > Can someone advise on the following. > > class class_y > { > function test() { > return "test"; > } > } > > class class_x > { > function x { > $n = new $y; > } > > fun

Re: [PHP] Making a object from one class available to all objects in the calling class

2001-02-05 Thread szii
IMHO, I'd use class class_y { function test() { return "test"; } } class class_x { $var m_SomeOtherClass; function x() { $this->m_SomeOtherClass = new class_y; } function z() { $this->m_SomeOtherClass->test(); } } AFAIK, there's