class fluent_class {
var $state_var;
function self_next( $arg ) {
....
return $this;
}
function other_next( $arg ) {
....
return $this->another;
}
}
$obj = new fluent_class();
$obj->self_next(1)
->self_next(2)
->other_next(3)
->something_else(4);