I think what you will want to do is to add some sort of status flag to the brakes class which indicates that they are broken. And then have your broken car class create the brake object and set broken to true.
class Brakes
{
var $status = 0; // All ok
function setStatus($status) {
$this->status = $status;
}
function brake()
{
switch($this->status) {
case 0: echo 'I am braking'; break;
case 1: echo 'I be broken'; break;
}
}
}
class BrokenCar extends Car
{
function BrokenCar()
{
$this>Car();
$this->brakes->setStatus(1);
}
}
And just to answer your question, no you cannot override a method in one class from another class unless they descend from each other. And you really don't want Cars to descend from Brakes.