NYCPHP Meetup

NYPHP.org

[nycphp-talk] Multi-Inheritance in PHP 5

csnyder chsnyder at gmail.com
Sun Oct 10 18:14:52 EDT 2004


The example was simplistic of course.

Let's say football::kickBall() is a complex method that needs to be
updated every time some external API changes (welcome to the world of
.NET, right?).

You have fifteeen diverse classes that you want to add kickBall()
functionality to.

Unless you want to copy-and-paste through fifteen source files every
time the damn football API changes, you have to jump through some kind
of hoop:

1) you refactor all of your classes to extend the football class
2) you implement football::kickBall() as a static method
3) you use classkit_method_copy()

The classkit solution is the least portable right now, but it also
seems the most useful if you don't want to (or can't; think PEAR)
rewrite your classes.



More information about the talk mailing list