How to access any function of a any class?

From: Date: Wed, 16 Mar 2005 13:27:02 +0000
Subject: How to access any function of a any class?
Groups: php.general 
Request: Send a blank email to php-general+get-210888@lists.php.net to get a copy of this message
Hello. Please consider this: class A { function A(&$Cont){ $this->Container= &$Cont; } function A_1(){ $this->Container->objB->B_1("somehing"); } } class B { function B(&$Cont){ $this->Container= &$Cont; } function B_1(){ //anything } } class Container{ function Container(){ $this->objA=new &A($this); $this->objB=new &B($this); } } $MyOBJ=new Container(); The problem is that "sometimes" member functions and variables can be reached this way, but sometimes not (mainly variables or file pointers) depending WHEN you create the object and when (for example) you create a file pointer inside some class. What I want to do is to be able to use any function of any class from any function of any class. Any ideas are welcome. Thanks a lot in advance!

« previous php.general (#210888) next »