You are here: RE: [PHP] How to access any function of a any class? « PHP « IT news, forums, messages
RE: [PHP] How to access any function of a any class?

Posted by Kim Madsen on 03/17/05 10:02

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация