Regarding the constructor, you can't return anything there, since the constructor will always return the newly created object, regardless of what you say. This is indeed an error in the book.
Regarding the return $this, that's used to create a so called "fluid interface" where you can "chain" methods. i.e.,
PHP Code:
<?php
$parcel = new Parcel();
$parcel->setCountry('Netherlands')->setWeight(10);
?>
as opposed to
PHP Code:
<?php
$parcel = new Parcel();
$parcel->setCountry('Netherlands');
$parcel->setWeight(10);
?>
which is what you would do if the methods didn't return $this.
This chaining is not used very much in PHP, but relied on heavily in javascript libraries like jQuery.
Regarding the autoloading thing, sadly that is indeed completely wrong as well.
Bookmarks