אין הורשה מרובה בPHP, אבל אפשר לעשות דבר כזה. מחלקה 2 יורשת את מחלקה 1 ומחלקה 3 יורשת את מחלקה 2:
PHP קוד:
<?php
class test1
{
function test1()
{
print 'test1';
}
}
class test2 extends test1
{
function test2()
{
print 'test2';
}
}
class test extends test2
{
function __construct()
{
$this->test1();
$this->test2();
}
}
$test = new test();
?>