Accessing subclass methods/members

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Accessing subclass methods/members

Post by alex.barylski »

In PHP 4 and 5 is this absolutely done via the Paamayim nekudotayim or scope resolution operator?

As I understand it (although I haven't tested) you can access base class members using either:

Code: Select all

ClassName::_someMethod
OR

Code: Select all

parent::_someMethod
Of which the latter is prefered, I know. ;)

I just need to make sure that using the :: operator is the ONLY way to directly access base class members???

p.s-practically anyways, using unusual hacks doesn't count. :)

Cheers :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

As usual, you need to try it.
Post Reply