-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 16, 2005 2:27 PM
To: php-general@lists.php.net
Subject: [PHP] How to access any function of a any class?

Hello.
Please consider this:

class A {
[snip]

class B {
[snip]

class Container{
  function Container(){
[snip]

$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.

Thatīs not possible if You wanna do _entirely_ OOPD programming. You can let B 
inherits from A and let Container inherits from B then an instance of Container 
will contain all functions, but a instance from A cannot call the function 
Container. Read more here: http://dk2.php.net/manual/en/keyword.extends.php

You could just drop the idea of several classes or the OOP programming (I 
removed the D on purpose due to the bad design ;-)

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper
Naverland 31

DK-2600 Glostrup
www.comx.dk
Telefon: +45 70 25 74 74
Telefax: +45 70 25 73 74
E-mail: [EMAIL PROTECTED]

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

Reply via email to