I'm trying to achieve some semblance of polymorphism with PHP4 (which I don't believe supports it natively). I was able to achieve this in C using a homemade object-C implementation, some tricky memory alignment, and the passing of function references to the "parent".