I am sorry I am still new to PHP by now and my questions may sound a bit ridiculous but i wonder what is the sense of the Type declaration of type Class/interface name? This was invented in PHP 5.0.0. I have searched also on stackoverflow but I did not found helpful information... In the php.net Documentation there are some examples for class type declaration but I did not really understand...

What I understand with class type declaration is:
The parameter must be an instanceof the given class or interface name. And I know that the parameter name of the variable is usually the same of the class certainly the variable is starting with Dollar sign and staring with lowercase. But I understand the other types better which are listed on <http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration> 

And there is Example #7 Basic class type declaration

```
class C {}
class D extends C {}

// This doesn't extend C.
class E {}

function f(C $c) {
    echo get_class($c)."\n";
}

f(new C);
f(new D);
f(new E);

```

The class C is empty, but what is if there is Code (for example some properties and methods) in it?

There are also Return type declarations:

So please can you help me with this:

```
public function test(): Class {}

```

When do i have to define the : and the Class and what is the purpose of it and how does it work?
I would also look forward if you have maybe some links with examples.