For example, is it possible to write code like this:
int $x = 6; str $y = \"hello world\"; bool $z = false; MyObject $foo = new MyObject();
Perhaps you should try this PHP extension https://github.com/krakjoe/strict. Support for the following types is introduced: