Pretending multiple runtime inheritance in php 5.X

Sometimes you REALLY need something that your programming language doesn't offers. Maybe because your programming language is obsolete, or because it offers you a different solution to the same problem, but you don't like this alternative solution.

Here i will discuss about how to implement multiple inheritance in php, not why, just how. Most of the times, if you need multiple inheritance in your classes, you could be able to solve the problem without it but HEY where's the fun?

Here's my implementation of an abstract class that you can extend in order to define your class that will need runtime inheritance-like funcitonalities.

<?php
class Pirate
{
public function doPirateStuff()
{
echo "YARRRRRRRR I SINK SHIPS!";
}
}

class Cyborg
{
public function doCyborgStuff()
{
echo "I DESTROY HUMANS";
}
}

class Ninja
{

public function doNinjaStuff()
{
echo "I SLICE AND DICE";
}
}

class SUPERHERO extends MultipleInheritant
{
public function __construct($name)
{
echo "I AM $name THE NEW SUPERHERO IN TOWN";
}
}

$s = new SUPERHERO('FATMAN');
$s->inherit('Ninja');
$s->inherit('Pirate');
$s->inherit('Cyborg');
$s->doCyborgStuff();
$s->doPirateStuff();
$s->doNinjaStuff();

The output for this, is:

I AM FATMAN THE NEW SUPERHERO IN TOWN
I DESTROY HUMANS
YARRRRRRRR I SINK SHIPS!
I SLICE AND DICE