How to access any function of a any class?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux