Type Hinting on a series of classes, extends from same class

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
fangel
Forum Newbie
Posts: 2
Joined: Fri Nov 19, 2004 1:14 pm
Location: Denmark - Roskilde - Lejre

Type Hinting on a series of classes, extends from same class

Post by fangel »

Hi,

I have a series of classes which extends from the class. I then wont to do Type Hinting, but I wan't all the classes to pass, is this possible by means of simple type hinting?

Would help a lot of it was..

Morten Fangel
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

what is the use of typehinting if you allow all types? :)


anyway, you could create an abstract class Object. And then let all classes extend that class. this way you can typehint Object
fangel
Forum Newbie
Posts: 2
Joined: Fri Nov 19, 2004 1:14 pm
Location: Denmark - Roskilde - Lejre

Post by fangel »

I don't wan't to allow _all_ types... I wan't to allow all classes which extends from _one_ class (ConfigBox)

Morten
Post Reply