RE: [PHP] How to access any function of a any class?

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


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-17-2005
Kim Madsen
 
Posts: n/a
Default RE: [PHP] How to access any function of a any class?


-----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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:18 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0