On Dec 18, 2007 5:45 PM, Chris <[EMAIL PROTECTED]> wrote:
> Jim Webber wrote:
> > Hello I have a PHP4 server and I'm trying to figure out how to do
> > "implements" on classes. Is there an analogous way to do this without
> > PHP5 installed?
>
> If you're using inheritance and child classes you could do it in a way,
> eg:
>
> class parent_class
> {
> function x()
> {
> echo 'You need to override this fn in your child class';
> }
> }
>
except that you have to waste usage of the extends keyword just to
'implement' parent_class. you can only implement one interface in this way.
there is no way to reasonably emulate the interface construct in php4.
in c++ you can emulate the interface construct by having a class that is
entirely virtual, but too bad; php4 doesnt have abstract classes either.
i recommend an upgrade to php5.
-nathan