In PHP 4 objects had to be manually dereferenced.

PHP4 Way
<?php
class foo_v4 {
    function 
bar() {
        return new 
bar_v4;
    }
}

class 
bar_v4 {
    function 
barbarina () {
        echo 
"booh!";
        echo 
"\n<br />\n";
    }
}

$f = new foo_v4;
$tmp $f->bar();
$tmp->barbarina();
?>
Output
booh!
PHP 5 Automatically dereferences objects for you.

PHP5 Way
<?php
class foo_v5 {
    function 
bar() {
        return new 
bar_v5;
    }
}

class 
bar_v5 {
    function 
barbarina () {
        echo 
"booh!";
        echo 
"\n<br />\n";
    }
}

$f = new foo_v5;
$f->bar()->barbarina();
?>
Output
booh!