编程书籍示例不起作用:汽车不是一个对象

The following code taken from a 2010 PHP book I a m currently reading returns a "Fatal error: Call to a member function getPrice() on a non-object in Z:\home\different-tasks\www\cardecorator.php on line 15" How come that a car is not an object?

<?php
abstract class AbstractCar {
    public abstract function getPrice();
    public abstract function getManufacturer();
};
class Car extends AbstractCar {
    private $price = 16000;
    private $manufacturer = 'Acme Autos';
    public function getPrice() { return $this->price; }
    public function getManufacturer() { return $this->manufacturer; }
};
class CarDecorator extends AbstractCar {
    private $target;
    function __construct( Car $target ) { $this->target = $target; }
    public function getPrice() { return $target->getPrice(); }
    public function getManufacturer() { return $target->getManufacturer(); }
};
class NavigationSystem extends CarDecorator {
    public function getPrice() { return parent::getPrice()+1000; }
};

$car = new Car();
$car = new NavigationSystem( $car );
//$car = new LeatherSeats( $car );
echo $car->getPrice();
 public function getPrice() { return $target->getPrice(); }

should be

 public function getPrice() { return $this->target->getPrice(); }

you have several mistakes like this there

I went on to download the examples from the publisher's site, and the downloadsable code works. The author explicitly mentioned in the preface that some elements of the examples given in the printed version might be missing to provide conciseness. So,I guess that I should study the code that is downloaded rather than what is printed.