This is a discussion on RE: [PHP] How to access any function of a any class? within the PHP General forums, part of the PHP Programming Forums category; -----Original Message----- From: pf@sistemasdinamicos.com.ar [mailto:pf@sistemasdinamicos.com.ar] Sent: Wednesday, March 16, 2005 2:27 PM ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
-----Original Message----- From: pf@sistemasdinamicos.com.ar [mailto:pf@sistemasdinamicos.com.ar] 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: km@comx.dk |